pub struct HashSetFormer<E, HashSet, Former, ContainerEnd>where
E: Eq + Hash,
HashSet: HashSetLike<E> + Default,
ContainerEnd: Fn(&mut Former, Option<HashSet>),{ /* private fields */ }Expand description
Class for forming hashset-like fields.
Implementations§
Source§impl<E, HashSet, Former, ContainerEnd> HashSetFormer<E, HashSet, Former, ContainerEnd>where
E: Eq + Hash,
HashSet: HashSetLike<E> + Default,
ContainerEnd: Fn(&mut Former, Option<HashSet>),
impl<E, HashSet, Former, ContainerEnd> HashSetFormer<E, HashSet, Former, ContainerEnd>where
E: Eq + Hash,
HashSet: HashSetLike<E> + Default,
ContainerEnd: Fn(&mut Former, Option<HashSet>),
Sourcepub fn new(
former: Former,
container: Option<HashSet>,
on_end: ContainerEnd,
) -> Self
pub fn new( former: Former, container: Option<HashSet>, on_end: ContainerEnd, ) -> Self
Make a new HashSetFormer. It should be called by a former generated for your structure.
Sourcepub fn replace(self, container: HashSet) -> Self
pub fn replace(self, container: HashSet) -> Self
Set the whole container instead of setting each element individually.
Trait Implementations§
Source§impl<E, HashSet, Former: Debug, ContainerEnd> Debug for HashSetFormer<E, HashSet, Former, ContainerEnd>where
E: Eq + Hash + Debug,
HashSet: HashSetLike<E> + Default + Debug,
ContainerEnd: Fn(&mut Former, Option<HashSet>) + Debug,
impl<E, HashSet, Former: Debug, ContainerEnd> Debug for HashSetFormer<E, HashSet, Former, ContainerEnd>where
E: Eq + Hash + Debug,
HashSet: HashSetLike<E> + Default + Debug,
ContainerEnd: Fn(&mut Former, Option<HashSet>) + Debug,
Source§impl<E, HashSet, Former: Default, ContainerEnd> Default for HashSetFormer<E, HashSet, Former, ContainerEnd>where
E: Eq + Hash + Default,
HashSet: HashSetLike<E> + Default + Default,
ContainerEnd: Fn(&mut Former, Option<HashSet>) + Default,
impl<E, HashSet, Former: Default, ContainerEnd> Default for HashSetFormer<E, HashSet, Former, ContainerEnd>where
E: Eq + Hash + Default,
HashSet: HashSetLike<E> + Default + Default,
ContainerEnd: Fn(&mut Former, Option<HashSet>) + Default,
Source§fn default() -> HashSetFormer<E, HashSet, Former, ContainerEnd>
fn default() -> HashSetFormer<E, HashSet, Former, ContainerEnd>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<E, HashSet, Former, ContainerEnd> Freeze for HashSetFormer<E, HashSet, Former, ContainerEnd>
impl<E, HashSet, Former, ContainerEnd> RefUnwindSafe for HashSetFormer<E, HashSet, Former, ContainerEnd>
impl<E, HashSet, Former, ContainerEnd> Send for HashSetFormer<E, HashSet, Former, ContainerEnd>
impl<E, HashSet, Former, ContainerEnd> Sync for HashSetFormer<E, HashSet, Former, ContainerEnd>
impl<E, HashSet, Former, ContainerEnd> Unpin for HashSetFormer<E, HashSet, Former, ContainerEnd>
impl<E, HashSet, Former, ContainerEnd> UnwindSafe for HashSetFormer<E, HashSet, Former, ContainerEnd>
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