Struct everscale_types::dict::AugDict
source · pub struct AugDict<C: CellFamily, K, A, V> { /* private fields */ }Expand description
Typed augmented dictionary with fixed length keys.
TLB scheme
ahm_edge#_ {n:#} {V:Type} {A:Type} {l:#} {m:#}
label:(HmLabel ~l n) {n = (~m) + l}
node:(HashmapAugNode m V A) = HashmapAug n V A;
ahmn_leaf#_ {V:Type} {A:Type} extra:A value:V = HashmapAugNode 0 V A;
ahmn_fork#_ {n:#} {V:Type} {A:Type} left:^(HashmapAug n V A)
right:^(HashmapAug n V A) extra:A = HashmapAugNode (n + 1) V A;
ahme_empty$0 {n:#} {V:Type} {A:Type} extra:A = HashmapAugE n V A;
ahme_root$1 {n:#} {V:Type} {A:Type} root:^(HashmapAug n V A) extra:A = HashmapAugE n V A;
Implementations§
source§impl<C: CellFamily, K, A: Default, V> AugDict<C, K, A, V>
impl<C: CellFamily, K, A: Default, V> AugDict<C, K, A, V>
source§impl<C: CellFamily, K, A, V> AugDict<C, K, A, V>
impl<C: CellFamily, K, A, V> AugDict<C, K, A, V>
source§impl<C, K, A, V> AugDict<C, K, A, V>where
for<'c> C: DefaultFinalizer + 'c,
K: Store<C> + DictKey,
impl<C, K, A, V> AugDict<C, K, A, V>where for<'c> C: DefaultFinalizer + 'c, K: Store<C> + DictKey,
source§impl<C, K, A, V> AugDict<C, K, A, V>where
for<'c> C: DefaultFinalizer + 'c,
K: Store<C> + DictKey,
impl<C, K, A, V> AugDict<C, K, A, V>where for<'c> C: DefaultFinalizer + 'c, K: Store<C> + DictKey,
source§impl<C, K, A, V> AugDict<C, K, A, V>where
for<'c> C: DefaultFinalizer + 'c,
K: DictKey,
impl<C, K, A, V> AugDict<C, K, A, V>where for<'c> C: DefaultFinalizer + 'c, K: DictKey,
sourcepub fn iter<'a>(&'a self) -> AugIter<'_, C, K, A, V> ⓘwhere
V: Load<'a, C>,
pub fn iter<'a>(&'a self) -> AugIter<'_, C, K, A, V> ⓘwhere V: Load<'a, C>,
Gets an iterator over the entries of the dictionary, sorted by key.
The iterator element type is Result<(K, A, V)>.
If the dictionary is invalid, finishes after the first invalid element, returning an error.
Performance
In the current implementation, iterating over dictionary builds a key
for each element. Use values or raw_values if you don’t need keys from an iterator.
sourcepub fn keys(&self) -> Keys<'_, C, K> ⓘ
pub fn keys(&self) -> Keys<'_, C, K> ⓘ
Gets an iterator over the keys of the dictionary, in sorted order.
The iterator element type is Result<K>.
If the dictionary is invalid, finishes after the first invalid element, returning an error.
Performance
In the current implementation, iterating over dictionary builds a key
for each element. Use values if you don’t need keys from an iterator.
source§impl<C, K, A, V> AugDict<C, K, A, V>where
for<'c> C: DefaultFinalizer + 'c,
K: DictKey,
impl<C, K, A, V> AugDict<C, K, A, V>where for<'c> C: DefaultFinalizer + 'c, K: DictKey,
source§impl<C, K, A, V> AugDict<C, K, A, V>where
for<'c> C: CellFamily + 'c,
K: Store<C> + DictKey,
impl<C, K, A, V> AugDict<C, K, A, V>where for<'c> C: CellFamily + 'c, K: Store<C> + DictKey,
sourcepub fn get_ext<'a: 'b, 'b, Q>(
&'a self,
key: Q,
finalizer: &mut dyn Finalizer<C>
) -> Result<Option<(A, V)>, Error>where
Q: Borrow<K> + 'b,
A: Load<'a, C>,
V: Load<'a, C>,
pub fn get_ext<'a: 'b, 'b, Q>( &'a self, key: Q, finalizer: &mut dyn Finalizer<C> ) -> Result<Option<(A, V)>, Error>where Q: Borrow<K> + 'b, A: Load<'a, C>, V: Load<'a, C>,
Returns the augmented value corresponding to the key.
Key is serialized using the provided finalizer.
sourcepub fn raw_iter(&self) -> RawIter<'_, C> ⓘ
pub fn raw_iter(&self) -> RawIter<'_, C> ⓘ
Gets an iterator over the raw entries of the dictionary, sorted by key.
The iterator element type is Result<(CellBuilder<C>, CellSlice<C>)>.
If the dictionary is invalid, finishes after the first invalid element, returning an error.
Performance
In the current implementation, iterating over dictionary builds a key
for each element. Use values or raw_values if you don’t need keys from an iterator.
sourcepub fn raw_keys(&self) -> RawKeys<'_, C> ⓘ
pub fn raw_keys(&self) -> RawKeys<'_, C> ⓘ
Gets an iterator over the raw keys of the dictionary, in sorted order.
The iterator element type is Result<CellBuilder<C>>.
If the dictionary is invalid, finishes after the first invalid element, returning an error.
Performance
In the current implementation, iterating over dictionary builds a key
for each element. Use values or raw_values if you don’t need keys from an iterator.
source§impl<C, K, A, V> AugDict<C, K, A, V>where
for<'c> C: CellFamily + 'c,
K: DictKey,
impl<C, K, A, V> AugDict<C, K, A, V>where for<'c> C: CellFamily + 'c, K: DictKey,
sourcepub fn raw_values(&self) -> RawValues<'_, C> ⓘ
pub fn raw_values(&self) -> RawValues<'_, C> ⓘ
Gets an iterator over the raw values of the dictionary, in order by key.
The iterator element type is Result<CellSlice<C>>.
If the dictionary is invalid, finishes after the first invalid element, returning an error.