pub struct Mapping<K, V> { /* private fields */ }Expand description
Apply the respective strategies to keys and values.
Trait Implementations§
Source§impl<K: Ord, SK: EncodingStrategy<K>, V, SV: EncodingStrategy<V>> EncodingStrategy<BTreeMap<K, V>> for Mapping<SK, SV>
impl<K: Ord, SK: EncodingStrategy<K>, V, SV: EncodingStrategy<V>> EncodingStrategy<BTreeMap<K, V>> for Mapping<SK, SV>
Source§type Context = MapContext<K, V, SK, SV>
type Context = MapContext<K, V, SK, SV>
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§fn encode<W: Write>(
value: &BTreeMap<K, V>,
writer: &mut Writer<W>,
ctx: &mut Self::Context,
) -> Result<(), Error>
fn encode<W: Write>( value: &BTreeMap<K, V>, writer: &mut Writer<W>, ctx: &mut Self::Context, ) -> Result<(), Error>
Encode the value with this strategy.
Source§impl<K: Ord, SK: EncodingStrategy<K>, V, SV: EncodingStrategy<V>> EncodingStrategy<BTreeMap<K, V>> for Mapping<SK, SV>
impl<K: Ord, SK: EncodingStrategy<K>, V, SV: EncodingStrategy<V>> EncodingStrategy<BTreeMap<K, V>> for Mapping<SK, SV>
Source§impl<K: Hash + Eq, SK: EncodingStrategy<K>, V, SV: EncodingStrategy<V>> EncodingStrategy<HashMap<K, V>> for Mapping<SK, SV>
impl<K: Hash + Eq, SK: EncodingStrategy<K>, V, SV: EncodingStrategy<V>> EncodingStrategy<HashMap<K, V>> for Mapping<SK, SV>
Source§type Context = MapContext<K, V, SK, SV>
type Context = MapContext<K, V, SK, SV>
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§fn encode<W: Write>(
value: &HashMap<K, V>,
writer: &mut Writer<W>,
ctx: &mut Self::Context,
) -> Result<(), Error>
fn encode<W: Write>( value: &HashMap<K, V>, writer: &mut Writer<W>, ctx: &mut Self::Context, ) -> Result<(), Error>
Encode the value with this strategy.
Source§impl<K: Hash + Eq, SK: EncodingStrategy<K>, V, SV: EncodingStrategy<V>> EncodingStrategy<HashMap<K, V>> for Mapping<SK, SV>
impl<K: Hash + Eq, SK: EncodingStrategy<K>, V, SV: EncodingStrategy<V>> EncodingStrategy<HashMap<K, V>> for Mapping<SK, SV>
Source§impl<K: Ord, V: Ord> Ord for Mapping<K, V>
impl<K: Ord, V: Ord> Ord for Mapping<K, V>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<K: PartialOrd, V: PartialOrd> PartialOrd for Mapping<K, V>
impl<K: PartialOrd, V: PartialOrd> PartialOrd for Mapping<K, V>
impl<K: Copy, V: Copy> Copy for Mapping<K, V>
impl<K: Eq, V: Eq> Eq for Mapping<K, V>
impl<K, V> StructuralPartialEq for Mapping<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for Mapping<K, V>
impl<K, V> RefUnwindSafe for Mapping<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Mapping<K, V>
impl<K, V> Sync for Mapping<K, V>
impl<K, V> Unpin for Mapping<K, V>
impl<K, V> UnsafeUnpin for Mapping<K, V>
impl<K, V> UnwindSafe for Mapping<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