pub struct AsyncVersionedMap<'a, S: AsyncStore> { /* private fields */ }Expand description
Async counterpart to VersionedMap for remote and browser stores.
Implementations§
Source§impl<'a, S: AsyncStore> AsyncVersionedMap<'a, S>
impl<'a, S: AsyncStore> AsyncVersionedMap<'a, S>
Source§impl<'a, S> AsyncVersionedMap<'a, S>where
S: AsyncStore + AsyncManifestStore,
<S as AsyncStore>::Error: Send + Sync,
<S as AsyncManifestStore>::Error: Send + Sync,
impl<'a, S> AsyncVersionedMap<'a, S>where
S: AsyncStore + AsyncManifestStore,
<S as AsyncStore>::Error: Send + Sync,
<S as AsyncManifestStore>::Error: Send + Sync,
Sourcepub async fn version(
&self,
id: &MapVersionId,
) -> Result<Option<MapVersion>, Error>
pub async fn version( &self, id: &MapVersionId, ) -> Result<Option<MapVersion>, Error>
Load a cataloged immutable version.
Sourcepub async fn snapshot(&self) -> Result<Option<AsyncMapSnapshot<'a, S>>, Error>
pub async fn snapshot(&self) -> Result<Option<AsyncMapSnapshot<'a, S>>, Error>
Pin current head for repeatable async reads.
Sourcepub async fn snapshot_at(
&self,
id: &MapVersionId,
) -> Result<Option<AsyncMapSnapshot<'a, S>>, Error>
pub async fn snapshot_at( &self, id: &MapVersionId, ) -> Result<Option<AsyncMapSnapshot<'a, S>>, Error>
Pin one cataloged historical version for repeatable async reads.
Sourcepub async fn subscribe(
&self,
) -> Result<AsyncMapChangeSubscription<'a, S>, Error>
pub async fn subscribe( &self, ) -> Result<AsyncMapChangeSubscription<'a, S>, Error>
Start observing future async head transitions from the current head.
Sourcepub fn subscribe_from(
&self,
last_seen: Option<MapVersionId>,
) -> AsyncMapChangeSubscription<'a, S>
pub fn subscribe_from( &self, last_seen: Option<MapVersionId>, ) -> AsyncMapChangeSubscription<'a, S>
Resume async observation from a previously persisted version.
Source§impl<S> AsyncVersionedMap<'_, S>where
S: AsyncStore + AsyncManifestStore + AsyncTransactionalStore,
<S as AsyncStore>::Error: Send + Sync,
<S as AsyncManifestStore>::Error: Send + Sync,
impl<S> AsyncVersionedMap<'_, S>where
S: AsyncStore + AsyncManifestStore + AsyncTransactionalStore,
<S as AsyncStore>::Error: Send + Sync,
<S as AsyncManifestStore>::Error: Send + Sync,
Sourcepub async fn apply(&self, mutations: Vec<Mutation>) -> Result<MapVersion, Error>
pub async fn apply(&self, mutations: Vec<Mutation>) -> Result<MapVersion, Error>
Atomically apply a batch and retry optimistic head conflicts.
Sourcepub async fn apply_at_millis(
&self,
mutations: Vec<Mutation>,
timestamp_millis: u64,
) -> Result<MapVersion, Error>
pub async fn apply_at_millis( &self, mutations: Vec<Mutation>, timestamp_millis: u64, ) -> Result<MapVersion, Error>
Atomically apply a batch with an explicit catalog timestamp.
Sourcepub async fn apply_if_at_millis(
&self,
expected: Option<&MapVersionId>,
mutations: Vec<Mutation>,
timestamp_millis: u64,
) -> Result<VersionedMapUpdate, Error>
pub async fn apply_if_at_millis( &self, expected: Option<&MapVersionId>, mutations: Vec<Mutation>, timestamp_millis: u64, ) -> Result<VersionedMapUpdate, Error>
Apply a batch only when expected is still the current version.
Sourcepub async fn put(
&self,
key: impl Into<Vec<u8>>,
value: impl Into<Vec<u8>>,
) -> Result<MapVersion, Error>
pub async fn put( &self, key: impl Into<Vec<u8>>, value: impl Into<Vec<u8>>, ) -> Result<MapVersion, Error>
Put one key asynchronously.
Sourcepub async fn delete(&self, key: impl Into<Vec<u8>>) -> Result<MapVersion, Error>
pub async fn delete(&self, key: impl Into<Vec<u8>>) -> Result<MapVersion, Error>
Delete one key asynchronously.
Sourcepub async fn edit(
&self,
edit: impl FnOnce(&mut VersionedMapEditor),
) -> Result<MapVersion, Error>
pub async fn edit( &self, edit: impl FnOnce(&mut VersionedMapEditor), ) -> Result<MapVersion, Error>
Collect and apply several asynchronous managed-map edits.
Auto Trait Implementations§
impl<'a, S> Freeze for AsyncVersionedMap<'a, S>
impl<'a, S> RefUnwindSafe for AsyncVersionedMap<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for AsyncVersionedMap<'a, S>where
S: Sync,
impl<'a, S> Sync for AsyncVersionedMap<'a, S>where
S: Sync,
impl<'a, S> Unpin for AsyncVersionedMap<'a, S>
impl<'a, S> UnsafeUnpin for AsyncVersionedMap<'a, S>
impl<'a, S> UnwindSafe for AsyncVersionedMap<'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