pub struct SnapshotManager<'a, S: Store> { /* private fields */ }Expand description
Convenience API for branch, tag, checkpoint, or custom snapshot roots.
Implementations§
Source§impl<'a, S: Store> SnapshotManager<'a, S>
impl<'a, S: Store> SnapshotManager<'a, S>
Sourcepub fn new(prolly: &'a Prolly<S>, namespace: SnapshotNamespace) -> Self
pub fn new(prolly: &'a Prolly<S>, namespace: SnapshotNamespace) -> Self
Create a manager for namespace using an existing Prolly manager.
Sourcepub fn namespace(&self) -> &SnapshotNamespace
pub fn namespace(&self) -> &SnapshotNamespace
Return the namespace used by this manager.
Sourcepub fn root_name(&self, id: impl AsRef<[u8]>) -> Vec<u8> ⓘ
pub fn root_name(&self, id: impl AsRef<[u8]>) -> Vec<u8> ⓘ
Build a durable named-root key from a namespace-local id.
Sourcepub fn load(&self, id: impl AsRef<[u8]>) -> Result<Option<Tree>, Error>where
S: ManifestStore,
pub fn load(&self, id: impl AsRef<[u8]>) -> Result<Option<Tree>, Error>where
S: ManifestStore,
Load one snapshot by namespace-local id.
Sourcepub fn load_many<I, Id>(&self, ids: I) -> Result<SnapshotSelection, Error>
pub fn load_many<I, Id>(&self, ids: I) -> Result<SnapshotSelection, Error>
Load several snapshots by namespace-local id.
Sourcepub fn publish(&self, id: impl AsRef<[u8]>, tree: &Tree) -> Result<(), Error>where
S: ManifestStore,
pub fn publish(&self, id: impl AsRef<[u8]>, tree: &Tree) -> Result<(), Error>where
S: ManifestStore,
Publish or replace a snapshot.
Sourcepub fn publish_at_millis(
&self,
id: impl AsRef<[u8]>,
tree: &Tree,
timestamp_millis: u64,
) -> Result<(), Error>where
S: ManifestStore,
pub fn publish_at_millis(
&self,
id: impl AsRef<[u8]>,
tree: &Tree,
timestamp_millis: u64,
) -> Result<(), Error>where
S: ManifestStore,
Publish or replace a snapshot with an explicit timestamp.
Sourcepub fn delete(&self, id: impl AsRef<[u8]>) -> Result<(), Error>where
S: ManifestStore,
pub fn delete(&self, id: impl AsRef<[u8]>) -> Result<(), Error>where
S: ManifestStore,
Delete a snapshot. Deleting a missing snapshot is not an error.
Sourcepub fn compare_and_swap(
&self,
id: impl AsRef<[u8]>,
expected: Option<&Tree>,
replacement: Option<&Tree>,
) -> Result<NamedRootUpdate, Error>where
S: ManifestStore,
pub fn compare_and_swap(
&self,
id: impl AsRef<[u8]>,
expected: Option<&Tree>,
replacement: Option<&Tree>,
) -> Result<NamedRootUpdate, Error>where
S: ManifestStore,
Atomically update a snapshot when the current tree matches expected.
Sourcepub fn compare_and_swap_at_millis(
&self,
id: impl AsRef<[u8]>,
expected: Option<&Tree>,
replacement: Option<&Tree>,
timestamp_millis: u64,
) -> Result<NamedRootUpdate, Error>where
S: ManifestStore,
pub fn compare_and_swap_at_millis(
&self,
id: impl AsRef<[u8]>,
expected: Option<&Tree>,
replacement: Option<&Tree>,
timestamp_millis: u64,
) -> Result<NamedRootUpdate, Error>where
S: ManifestStore,
Atomically update a snapshot with an explicit timestamp.
Sourcepub fn list(&self) -> Result<Vec<SnapshotRoot>, Error>where
S: ManifestStoreScan,
pub fn list(&self) -> Result<Vec<SnapshotRoot>, Error>where
S: ManifestStoreScan,
List all snapshots in this namespace.
Auto Trait Implementations§
impl<'a, S> Freeze for SnapshotManager<'a, S>
impl<'a, S> RefUnwindSafe for SnapshotManager<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for SnapshotManager<'a, S>
impl<'a, S> Sync for SnapshotManager<'a, S>
impl<'a, S> Unpin for SnapshotManager<'a, S>
impl<'a, S> UnsafeUnpin for SnapshotManager<'a, S>
impl<'a, S> UnwindSafe for SnapshotManager<'a, S>where
S: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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