pub struct MutableMap<'a, K, V> { /* private fields */ }Expand description
An owned mutable map with dirty tracking and ProtoCache key encoding.
Implementations§
Source§impl<'a, K: Eq + Hash, V> MutableMap<'a, K, V>
impl<'a, K: Eq + Hash, V> MutableMap<'a, K, V>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn reserve(&mut self, additional: usize)
Sourcepub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn insert(&mut self, key: K, value: V) -> Option<V>
Inserts an entry and marks the map dirty.
pub fn contains_key<Q>(&self, key: &Q) -> bool
pub fn get<Q>(&self, key: &Q) -> Option<&V>
Sourcepub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
Returns mutable access to a value and marks the map dirty when found.
pub fn remove<Q>(&mut self, key: &Q) -> Option<V>
pub fn iter(&self) -> impl Iterator<Item = (&K, &V)>
Source§impl<'a, K: MutableMapKey<'a>, V: MutableField<'a>> MutableMap<'a, K, V>
impl<'a, K: MutableMapKey<'a>, V: MutableField<'a>> MutableMap<'a, K, V>
Sourcepub fn from_words(words: &'a [u32]) -> Option<Self>
pub fn from_words(words: &'a [u32]) -> Option<Self>
Decodes all entries from an encoded map.
Sourcepub fn encode_to_unit(&self, buffer: &mut Buffer) -> Result<Unit, MutableError>
pub fn encode_to_unit(&self, buffer: &mut Buffer) -> Result<Unit, MutableError>
Encodes the map and its perfect-hash index into buffer.
Trait Implementations§
Source§impl<'a, K: Clone, V: Clone> Clone for MutableMap<'a, K, V>
impl<'a, K: Clone, V: Clone> Clone for MutableMap<'a, K, V>
Source§fn clone(&self) -> MutableMap<'a, K, V>
fn clone(&self) -> MutableMap<'a, K, V>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a, K, V> Default for MutableMap<'a, K, V>
impl<'a, K, V> Default for MutableMap<'a, K, V>
Source§impl<'a, K: Eq + Hash, V> Extend<(K, V)> for MutableMap<'a, K, V>
impl<'a, K: Eq + Hash, V> Extend<(K, V)> for MutableMap<'a, K, V>
Source§fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<'a, K, V> From<HashMap<K, V>> for MutableMap<'a, K, V>
impl<'a, K, V> From<HashMap<K, V>> for MutableMap<'a, K, V>
Source§impl<'a, K: Eq + Hash, V> FromIterator<(K, V)> for MutableMap<'a, K, V>
impl<'a, K: Eq + Hash, V> FromIterator<(K, V)> for MutableMap<'a, K, V>
Source§impl<'b, 'a, K, V> IntoIterator for &'b MutableMap<'a, K, V>
impl<'b, 'a, K, V> IntoIterator for &'b MutableMap<'a, K, V>
Source§impl<'b, 'a, K, V> IntoIterator for &'b mut MutableMap<'a, K, V>
impl<'b, 'a, K, V> IntoIterator for &'b mut MutableMap<'a, K, V>
Source§impl<'a, K: MutableMapKey<'a>, V: MutableField<'a>> MutableArrayElement<'a> for MutableMap<'a, K, V>
impl<'a, K: MutableMapKey<'a>, V: MutableField<'a>> MutableArrayElement<'a> for MutableMap<'a, K, V>
fn decode_array(words: &'a [u32]) -> Option<Vec<Self>>
fn encode_array( values: &[Self], buffer: &mut Buffer, ) -> Result<Unit, MutableError>
fn detect_array_words(words: &'a [u32]) -> Option<&'a [u32]>
fn detect_array_field(field: FieldView<'a>) -> Option<&'a [u32]>
Source§impl<'a, K: MutableMapKey<'a>, V: MutableField<'a>> MutableField<'a> for MutableMap<'a, K, V>
impl<'a, K: MutableMapKey<'a>, V: MutableField<'a>> MutableField<'a> for MutableMap<'a, K, V>
fn decode(field: FieldView<'a>) -> Option<Self>
fn detect(field: FieldView<'a>) -> Option<&'a [u32]>
fn encode(&self, buffer: &mut Buffer) -> Result<Unit, MutableError>
fn is_empty_field(&self) -> bool
fn omits_default_after_encode() -> boolwhere
Self: Sized,
fn is_dirty(&self) -> bool
fn has_nested_dirty(&self) -> bool
fn folds_when_present() -> boolwhere
Self: Sized,
Auto Trait Implementations§
impl<'a, K, V> Freeze for MutableMap<'a, K, V>
impl<'a, K, V> RefUnwindSafe for MutableMap<'a, K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<'a, K, V> Send for MutableMap<'a, K, V>
impl<'a, K, V> Sync for MutableMap<'a, K, V>
impl<'a, K, V> Unpin for MutableMap<'a, K, V>
impl<'a, K, V> UnsafeUnpin for MutableMap<'a, K, V>
impl<'a, K, V> UnwindSafe for MutableMap<'a, K, V>where
K: UnwindSafe,
V: UnwindSafe,
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