pub struct MapContext<E: Entry, C: Converter> { /* private fields */ }Expand description
The common implementation of all map-like contexts.
Implementations§
Source§impl<E: Entry, C: Converter> MapContext<E, C>
impl<E: Entry, C: Converter> MapContext<E, C>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new MapContext.
Trait Implementations§
Source§impl<E: Entry, C: Converter> AbstractContext for MapContext<E, C>
impl<E: Entry, C: Converter> AbstractContext for MapContext<E, C>
Source§type Iter<'a> = CommonIter<'a, E, Iter<'a, E>>
where
E: 'a
type Iter<'a> = CommonIter<'a, E, Iter<'a, E>> where E: 'a
The iterator over this context’s entries.
Source§impl<E: Entry, C: Converter> Context for MapContext<E, C>
impl<E: Entry, C: Converter> Context for MapContext<E, C>
Source§type Converter = C
type Converter = C
The default converter used by the context, which transforms values to
AbstractContext::Value before insertions.Source§fn insert<Q, R>(&mut self, key: Q, value: R)
fn insert<Q, R>(&mut self, key: Q, value: R)
Inserts the context information represented as a key-value pair. Any
types that are compatible with
AbstractContext::Key and
AbstractContext::Value through the Into trait respectively are
expected.Source§fn get<Q>(&self, key: &Q) -> Option<&<Self::Entry as Entry>::ValueBorrowed>
fn get<Q>(&self, key: &Q) -> Option<&<Self::Entry as Entry>::ValueBorrowed>
Returns the value corresponding to the given key.
Source§fn insert_with<C, Q, R>(&mut self, key: Q, value: R)
fn insert_with<C, Q, R>(&mut self, key: Q, value: R)
Converts the context information represented as a key-value pair using
the specified converter
C and then inserts the converted pair. Any
types that are compatible with AbstractContext::Key and
AbstractContext::Value through the Into and Convertable
trait respectively are expected.impl<E: Eq + Entry, C: Eq + Converter> Eq for MapContext<E, C>
Source§impl<E: Entry, C: Converter, Q, R> FromIterator<(Q, R)> for MapContext<E, C>
impl<E: Entry, C: Converter, Q, R> FromIterator<(Q, R)> for MapContext<E, C>
Source§impl<E: Entry, C: Converter> FromIterator<E> for MapContext<E, C>
impl<E: Entry, C: Converter> FromIterator<E> for MapContext<E, C>
Source§fn from_iter<T: IntoIterator<Item = E>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = E>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl<E: PartialEq + Entry, C: PartialEq + Converter> PartialEq for MapContext<E, C>
impl<E: PartialEq + Entry, C: PartialEq + Converter> PartialEq for MapContext<E, C>
Source§fn eq(&self, other: &MapContext<E, C>) -> bool
fn eq(&self, other: &MapContext<E, C>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<E: PartialEq + Entry, C: PartialEq + Converter> StructuralPartialEq for MapContext<E, C>
Auto Trait Implementations§
impl<E, C> Freeze for MapContext<E, C>
impl<E, C> RefUnwindSafe for MapContext<E, C>where
C: RefUnwindSafe,
E: RefUnwindSafe,
impl<E, C> Send for MapContext<E, C>
impl<E, C> Sync for MapContext<E, C>
impl<E, C> Unpin for MapContext<E, C>
impl<E, C> UnsafeUnpin for MapContext<E, C>
impl<E, C> UnwindSafe for MapContext<E, C>where
C: UnwindSafe,
E: 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
Source§impl<S, T> Convertable<BoxConverter, T> for S
impl<S, T> Convertable<BoxConverter, T> for S
Source§fn to(self) -> T
fn to(self) -> T
Converts the value into another type
T using the specified converter
C. The conversion should not fail, so not a Result<T, E> but a
T is expected. Read moreSource§impl<S, T> Convertable<DebugConverter, T> for S
impl<S, T> Convertable<DebugConverter, T> for S
Source§fn to(self) -> T
fn to(self) -> T
Converts the value into another type
T using the specified converter
C. The conversion should not fail, so not a Result<T, E> but a
T is expected. Read moreSource§impl<S, T> Convertable<IntoConverter, T> for Swhere
S: Into<T>,
impl<S, T> Convertable<IntoConverter, T> for Swhere
S: Into<T>,
Source§fn to(self) -> T
fn to(self) -> T
Converts the value into another type
T using the specified converter
C. The conversion should not fail, so not a Result<T, E> but a
T is expected. Read more