pub struct TypedVersionedMap<'a, S: Store, K, V, KC, VC> { /* private fields */ }Expand description
Typed facade over a byte-oriented VersionedMap.
Implementations§
Source§impl<'a, S: Store, K, V, KC, VC> TypedVersionedMap<'a, S, K, V, KC, VC>
impl<'a, S: Store, K, V, KC, VC> TypedVersionedMap<'a, S, K, V, KC, VC>
Sourcepub fn raw(&self) -> &VersionedMap<'a, S>
pub fn raw(&self) -> &VersionedMap<'a, S>
Borrow the byte-oriented managed map.
Source§impl<S, K, V, KC, VC> TypedVersionedMap<'_, S, K, V, KC, VC>
impl<S, K, V, KC, VC> TypedVersionedMap<'_, S, K, V, KC, VC>
Source§impl<S, K, V, KC, VC> TypedVersionedMap<'_, S, K, V, KC, VC>
impl<S, K, V, KC, VC> TypedVersionedMap<'_, S, K, V, KC, VC>
Sourcepub fn put(&self, key: &K, value: &V) -> Result<MapVersion, Error>
pub fn put(&self, key: &K, value: &V) -> Result<MapVersion, Error>
Encode and publish one typed value.
Sourcepub fn put_if(
&self,
expected: Option<&MapVersionId>,
key: &K,
value: &V,
) -> Result<VersionedMapUpdate, Error>
pub fn put_if( &self, expected: Option<&MapVersionId>, key: &K, value: &V, ) -> Result<VersionedMapUpdate, Error>
Conditionally encode and publish one typed value.
Sourcepub fn migrate_from<Old, OVC>(
&self,
expected: &MapVersionId,
source_codec: &OVC,
migrate: impl FnMut(Old) -> Result<V, Error>,
) -> Result<TypedMigrationResult, Error>where
Old: DeserializeOwned,
OVC: ValueCodec,
pub fn migrate_from<Old, OVC>(
&self,
expected: &MapVersionId,
source_codec: &OVC,
migrate: impl FnMut(Old) -> Result<V, Error>,
) -> Result<TypedMigrationResult, Error>where
Old: DeserializeOwned,
OVC: ValueCodec,
Rewrite every value from source_codec through migrate and CAS-publish.
Auto Trait Implementations§
impl<'a, S, K, V, KC, VC> Freeze for TypedVersionedMap<'a, S, K, V, KC, VC>
impl<'a, S, K, V, KC, VC> RefUnwindSafe for TypedVersionedMap<'a, S, K, V, KC, VC>
impl<'a, S, K, V, KC, VC> Send for TypedVersionedMap<'a, S, K, V, KC, VC>
impl<'a, S, K, V, KC, VC> Sync for TypedVersionedMap<'a, S, K, V, KC, VC>
impl<'a, S, K, V, KC, VC> Unpin for TypedVersionedMap<'a, S, K, V, KC, VC>
impl<'a, S, K, V, KC, VC> UnsafeUnpin for TypedVersionedMap<'a, S, K, V, KC, VC>where
KC: UnsafeUnpin,
VC: UnsafeUnpin,
impl<'a, S, K, V, KC, VC> UnwindSafe for TypedVersionedMap<'a, S, K, V, KC, VC>
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