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,
) -> Self
pub fn new( former: Former, container: Option<HashMap>, on_end: ContainerEnd, ) -> Self
Make a new HashMapFormer. It should be called by a former generated for your structure.
Sourcepub fn replace(self, container: HashMap) -> Self
pub fn replace(self, container: HashMap) -> Self
Set the whole container instead of setting each element individually.
Trait Implementations§
Source§impl<K, E: Debug, HashMap, Former: Debug, ContainerEnd> Debug for HashMapFormer<K, E, HashMap, Former, ContainerEnd>where
K: Eq + Hash + Debug,
HashMap: HashMapLike<K, E> + Default + Debug,
ContainerEnd: Fn(&mut Former, Option<HashMap>) + Debug,
impl<K, E: Debug, HashMap, Former: Debug, ContainerEnd> Debug for HashMapFormer<K, E, HashMap, Former, ContainerEnd>where
K: Eq + Hash + Debug,
HashMap: HashMapLike<K, E> + Default + Debug,
ContainerEnd: Fn(&mut Former, Option<HashMap>) + Debug,
Source§impl<K, E: Default, HashMap, Former: Default, ContainerEnd> Default for HashMapFormer<K, E, HashMap, Former, ContainerEnd>where
K: Eq + Hash + Default,
HashMap: HashMapLike<K, E> + Default + Default,
ContainerEnd: Fn(&mut Former, Option<HashMap>) + Default,
impl<K, E: Default, HashMap, Former: Default, ContainerEnd> Default for HashMapFormer<K, E, HashMap, Former, ContainerEnd>where
K: Eq + Hash + Default,
HashMap: HashMapLike<K, E> + Default + Default,
ContainerEnd: Fn(&mut Former, Option<HashMap>) + Default,
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