Primadb

Struct Primadb 

Source
pub struct Primadb { /* private fields */ }

Implementations§

Source§

impl Primadb

Source

pub fn with_replica_id(replica_id: impl Into<String>) -> Self

Source

pub fn replica_id(&self) -> String

Source

pub fn root(&self, node: impl Into<String>) -> Chain

Source

pub fn snapshot(&self) -> DatabaseSnapshot

Source

pub fn export_snapshot_json(&self) -> Result<String>

Source

pub fn export_persisted_snapshot_json(&self) -> Result<String>

Source

pub fn import_snapshot_json(&self, payload: &str) -> Result<()>

Source

pub fn merge_snapshot_json(&self, payload: &str) -> Result<()>

Source

pub fn import_persisted_snapshot_json(&self, payload: &str) -> Result<()>

Source

pub fn load_snapshot(&self, snapshot: DatabaseSnapshot) -> Result<()>

Source

pub fn merge_snapshot(&self, snapshot: DatabaseSnapshot) -> Result<()>

Source

pub fn pending_operations(&self) -> Vec<Operation>

Source

pub fn change_revision(&self) -> u64

Source

pub fn sync_envelope(&self) -> SyncEnvelope

Source

pub fn drain_pending_operations(&self) -> Result<Vec<Operation>>

Source

pub fn requeue_pending_operations<I>(&self, ops: I) -> Result<usize>
where I: IntoIterator<Item = Operation>,

Source

pub fn drain_sync_envelope(&self) -> Result<SyncEnvelope>

Source

pub fn export_pending_operations_json(&self) -> Result<String>

Source

pub fn drain_pending_operations_json(&self) -> Result<String>

Source

pub fn apply_operation(&self, op: Operation) -> Result<bool>

Source

pub fn apply_operations<I>(&self, ops: I) -> Result<usize>
where I: IntoIterator<Item = Operation>,

Source

pub fn apply_sync_envelope(&self, envelope: SyncEnvelope) -> Result<usize>

Source

pub fn apply_operations_json(&self, payload: &str) -> Result<usize>

Source

pub fn get_path(&self, path: &RemotePath) -> Result<Option<JsonValue>>

Source

pub fn map_path(&self, path: &RemotePath) -> Result<Vec<MapEntry>>

Source

pub fn query_path( &self, path: &RemotePath, spec: &QuerySpec, ) -> Result<Vec<MapEntry>>

Source

pub fn lex_path( &self, path: &RemotePath, spec: &LexSpec, ) -> Result<Vec<LexEntry>>

Source

pub fn snapshot_for_root(&self, root: Option<&str>) -> DatabaseSnapshot

Source

pub fn execute_pull_request_kind( &self, request: &PullRequestKind, ) -> Result<RemoteResult>

Source

pub fn execute_pull_request( &self, request: &PullRequest, ) -> Result<RemoteResult>

Source

pub fn chunk_remote_result( &self, request_id: &str, result: RemoteResult, ) -> Vec<PullResponse>

Source

pub fn chunk_watch_result( &self, watch_id: &str, sequence: u64, initial: bool, result: RemoteResult, ) -> Vec<WatchEvent>

Source

pub fn subscribe_changes(&self) -> ChangeSubscription

Source

pub fn stats(&self) -> PrimadbStats

Source

pub fn limits(&self) -> PrimadbLimits

Source

pub fn set_limits(&self, limits: PrimadbLimits)

Source

pub fn set_network_hooks(&self, hooks: Arc<dyn NetworkHooks>)

Source

pub fn clear_network_hooks(&self)

Source

pub fn use_file_persistence(&self, path: impl Into<PathBuf>) -> Result<bool>

Source

pub fn use_radisk_storage( &self, directory: impl Into<PathBuf>, compaction_threshold: usize, ) -> Result<bool>

Source

pub fn open_durable_storage( &self, config: DurableStorageConfig, ) -> Result<DurableStorageBinding>

Source

pub fn attach_blob_store(&self, store: Arc<dyn BlobStore>)

Source

pub fn open_blob_storage( &self, config: BlobStorageConfig, ) -> Result<BlobStorageBinding>

Source

pub fn store_blob( &self, data: impl AsRef<[u8]>, media_type: Option<&str>, ) -> Result<BlobRef>

Source

pub fn get_blob(&self, blob_id: &str) -> Result<Option<StoredBlob>>

Source

pub fn vacuum_storage(&self) -> Result<VacuumReport>

Source

pub fn has_blob(&self, blob_id: &str) -> Result<bool>

Source

pub fn attach_storage_adapter( &self, adapter: Arc<dyn StorageAdapter>, ) -> Result<bool>

Source

pub fn attach_incremental_store( &self, store: Arc<dyn IncrementalStore>, ) -> Result<bool>

Trait Implementations§

Source§

impl Clone for Primadb

Source§

fn clone(&self) -> Primadb

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Primadb

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Primadb

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.