pub struct KeyValueStore { /* private fields */ }
Implementations§
source§impl KeyValueStore
impl KeyValueStore
pub fn to_hashmap(&self) -> HashMap<String, DataBuffer>
sourcepub fn value<S: BnStrCompatible>(&self, key: S) -> Option<DataBuffer>
pub fn value<S: BnStrCompatible>(&self, key: S) -> Option<DataBuffer>
Get the value for a single key
sourcepub fn set_value<S: BnStrCompatible>(&self, key: S, value: &DataBuffer) -> bool
pub fn set_value<S: BnStrCompatible>(&self, key: S, value: &DataBuffer) -> bool
Set the value for a single key
sourcepub fn serialized_data(&self) -> DataBuffer
pub fn serialized_data(&self) -> DataBuffer
Get the stored representation of the kvs
sourcepub fn begin_namespace<S: BnStrCompatible>(&self, name: S)
pub fn begin_namespace<S: BnStrCompatible>(&self, name: S)
Begin storing new keys into a namespace
sourcepub fn end_namespace(&self)
pub fn end_namespace(&self)
End storing new keys into a namespace
sourcepub fn value_size(&self) -> usize
pub fn value_size(&self) -> usize
Number of values in the kvs
sourcepub fn value_storage_size(&self) -> usize
pub fn value_storage_size(&self) -> usize
Size of all data in storage
sourcepub fn namespace_size(&self) -> usize
pub fn namespace_size(&self) -> usize
Number of namespaces pushed with begin_namespace
Trait Implementations§
source§impl Debug for KeyValueStore
impl Debug for KeyValueStore
source§impl ToOwned for KeyValueStore
impl ToOwned for KeyValueStore
source§type Owned = Ref<KeyValueStore>
type Owned = Ref<KeyValueStore>
The resulting type after obtaining ownership.
source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more
Auto Trait Implementations§
impl Freeze for KeyValueStore
impl RefUnwindSafe for KeyValueStore
impl !Send for KeyValueStore
impl !Sync for KeyValueStore
impl Unpin for KeyValueStore
impl UnwindSafe for KeyValueStore
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