pub struct HashMapFormer<K, E, HashMap, Former, ContainerEnd>where
K: Eq + Hash,
HashMap: HashMapLike<K, E> + Default,
ContainerEnd: Fn(&mut Former, Option<HashMap>),{ /* private fields */ }Expand description
Class for forming hashmap-like fields.
Implementations§
Source§impl<K, E, HashMap, Former, ContainerEnd> HashMapFormer<K, E, HashMap, Former, ContainerEnd>where
K: Eq + Hash,
HashMap: HashMapLike<K, E> + Default,
ContainerEnd: Fn(&mut Former, Option<HashMap>),
impl<K, E, HashMap, Former, ContainerEnd> HashMapFormer<K, E, HashMap, Former, ContainerEnd>where
K: Eq + Hash,
HashMap: HashMapLike<K, E> + Default,
ContainerEnd: Fn(&mut Former, Option<HashMap>),
Sourcepub fn new(
former: Former,
container: Option<HashMap>,
on_end: ContainerEnd,
) -> HashMapFormer<K, E, HashMap, Former, ContainerEnd>
pub fn new( former: Former, container: Option<HashMap>, on_end: ContainerEnd, ) -> HashMapFormer<K, E, HashMap, Former, ContainerEnd>
Make a new HashMapFormer. It should be called by a former generated for your structure.
Sourcepub fn replace(
self,
container: HashMap,
) -> HashMapFormer<K, E, HashMap, Former, ContainerEnd>
pub fn replace( self, container: HashMap, ) -> HashMapFormer<K, E, HashMap, Former, ContainerEnd>
Set the whole container instead of setting each element individually.
Sourcepub fn end(self) -> Former
pub fn end(self) -> Former
Return former of your struct moving container there. Should be called after configuring the container.
Sourcepub fn insert<K2, E2>(
self,
k: K2,
e: E2,
) -> HashMapFormer<K, E, HashMap, Former, ContainerEnd>
pub fn insert<K2, E2>( self, k: K2, e: E2, ) -> HashMapFormer<K, E, HashMap, Former, ContainerEnd>
Inserts a key-value pair into the map. Make a new container if it was not made so far.
Trait Implementations§
Source§impl<K, E, HashMap, Former, ContainerEnd> Debug for HashMapFormer<K, E, HashMap, Former, ContainerEnd>
impl<K, E, HashMap, Former, ContainerEnd> Debug for HashMapFormer<K, E, HashMap, Former, ContainerEnd>
Source§impl<K, E, HashMap, Former, ContainerEnd> Default for HashMapFormer<K, E, HashMap, Former, ContainerEnd>
impl<K, E, HashMap, Former, ContainerEnd> Default for HashMapFormer<K, E, HashMap, Former, ContainerEnd>
Source§fn default() -> HashMapFormer<K, E, HashMap, Former, ContainerEnd>
fn default() -> HashMapFormer<K, E, HashMap, Former, ContainerEnd>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<K, E, HashMap, Former, ContainerEnd> Freeze for HashMapFormer<K, E, HashMap, Former, ContainerEnd>
impl<K, E, HashMap, Former, ContainerEnd> RefUnwindSafe for HashMapFormer<K, E, HashMap, Former, ContainerEnd>where
Former: RefUnwindSafe,
ContainerEnd: RefUnwindSafe,
HashMap: RefUnwindSafe,
E: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, E, HashMap, Former, ContainerEnd> Send for HashMapFormer<K, E, HashMap, Former, ContainerEnd>
impl<K, E, HashMap, Former, ContainerEnd> Sync for HashMapFormer<K, E, HashMap, Former, ContainerEnd>
impl<K, E, HashMap, Former, ContainerEnd> Unpin for HashMapFormer<K, E, HashMap, Former, ContainerEnd>
impl<K, E, HashMap, Former, ContainerEnd> UnwindSafe for HashMapFormer<K, E, HashMap, Former, ContainerEnd>where
Former: UnwindSafe,
ContainerEnd: UnwindSafe,
HashMap: UnwindSafe,
E: UnwindSafe,
K: 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<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<Target, Original> VectorizedInto<Target> for Originalwhere
Target: VectorizedFrom<Original>,
impl<Target, Original> VectorizedInto<Target> for Originalwhere
Target: VectorizedFrom<Original>,
Source§fn vectorized_into(self) -> Target
fn vectorized_into(self) -> Target
Performs the conversion.