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,
) -> HashSetFormer<E, HashSet, Former, ContainerEnd>
pub fn new( former: Former, container: Option<HashSet>, on_end: ContainerEnd, ) -> HashSetFormer<E, HashSet, Former, ContainerEnd>
Make a new HashSetFormer. It should be called by a former generated for your structure.
Sourcepub fn replace(
self,
container: HashSet,
) -> HashSetFormer<E, HashSet, Former, ContainerEnd>
pub fn replace( self, container: HashSet, ) -> HashSetFormer<E, HashSet, 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<E2>(
self,
e: E2,
) -> HashSetFormer<E, HashSet, Former, ContainerEnd>where
E2: Into<E>,
pub fn insert<E2>(
self,
e: E2,
) -> HashSetFormer<E, HashSet, Former, ContainerEnd>where
E2: Into<E>,
Inserts a key-value pair into the map. Make a new container if it was not made so far.
Trait Implementations§
Source§impl<E, HashSet, Former, ContainerEnd> Debug for HashSetFormer<E, HashSet, Former, ContainerEnd>
impl<E, HashSet, Former, ContainerEnd> Debug for HashSetFormer<E, HashSet, Former, ContainerEnd>
Source§impl<E, HashSet, Former, ContainerEnd> Default for HashSetFormer<E, HashSet, Former, ContainerEnd>where
E: Default + Eq + Hash,
HashSet: Default + HashSetLike<E>,
Former: Default,
ContainerEnd: Default + Fn(&mut Former, Option<HashSet>),
impl<E, HashSet, Former, ContainerEnd> Default for HashSetFormer<E, HashSet, Former, ContainerEnd>where
E: Default + Eq + Hash,
HashSet: Default + HashSetLike<E>,
Former: Default,
ContainerEnd: Default + Fn(&mut Former, Option<HashSet>),
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
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.