pub struct ContentAddressedKvOptions<Ctx, V: Clone> {
pub kv: Rc<dyn KvStorageTier<V>>,
pub key_context: Rc<ContentAddressedKeyContext<Ctx>>,
pub key_prefix: Option<String>,
pub mode: ContentAddressedMode,
}Expand description
ContentAddressedKvOptions data container.
Fields§
§kv: Rc<dyn KvStorageTier<V>>kv field for kv.
key_context: Rc<ContentAddressedKeyContext<Ctx>>key_context field for key context.
key_prefix: Option<String>key_prefix field for key prefix.
mode: ContentAddressedModemode field for mode.
Implementations§
Source§impl<V: Clone> ContentAddressedKvOptions<Value, V>
impl<V: Clone> ContentAddressedKvOptions<Value, V>
Sourcepub fn new(kv: Rc<dyn KvStorageTier<V>>) -> Self
pub fn new(kv: Rc<dyn KvStorageTier<V>>) -> Self
Creates or computes new.
Source§impl<Ctx, V: Clone> ContentAddressedKvOptions<Ctx, V>
impl<Ctx, V: Clone> ContentAddressedKvOptions<Ctx, V>
Sourcepub fn from_key_context(
kv: Rc<dyn KvStorageTier<V>>,
f: impl Fn(&Ctx) -> Result<Value, JsonCodecError> + 'static,
) -> Self
pub fn from_key_context( kv: Rc<dyn KvStorageTier<V>>, f: impl Fn(&Ctx) -> Result<Value, JsonCodecError> + 'static, ) -> Self
Creates or computes from_key_context.
Sourcepub fn with_key_context(
self,
f: impl Fn(&Ctx) -> Result<Value, JsonCodecError> + 'static,
) -> Self
pub fn with_key_context( self, f: impl Fn(&Ctx) -> Result<Value, JsonCodecError> + 'static, ) -> Self
Updates or reads with_key_context.
Sourcepub fn with_key_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_key_prefix(self, prefix: impl Into<String>) -> Self
Updates or reads with_key_prefix.
Sourcepub fn with_mode(self, mode: ContentAddressedMode) -> Self
pub fn with_mode(self, mode: ContentAddressedMode) -> Self
Updates or reads with_mode.
Auto Trait Implementations§
impl<Ctx, V> Freeze for ContentAddressedKvOptions<Ctx, V>
impl<Ctx, V> !RefUnwindSafe for ContentAddressedKvOptions<Ctx, V>
impl<Ctx, V> !Send for ContentAddressedKvOptions<Ctx, V>
impl<Ctx, V> !Sync for ContentAddressedKvOptions<Ctx, V>
impl<Ctx, V> Unpin for ContentAddressedKvOptions<Ctx, V>
impl<Ctx, V> UnsafeUnpin for ContentAddressedKvOptions<Ctx, V>
impl<Ctx, V> !UnwindSafe for ContentAddressedKvOptions<Ctx, V>
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