HashMapFormer

Struct HashMapFormer 

Source
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>),

Source

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.

Source

pub fn replace( self, container: HashMap, ) -> HashMapFormer<K, E, HashMap, Former, ContainerEnd>

Set the whole container instead of setting each element individually.

Source

pub fn end(self) -> Former

Return former of your struct moving container there. Should be called after configuring the container.

Source

pub fn insert<K2, E2>( self, k: K2, e: E2, ) -> HashMapFormer<K, E, HashMap, Former, ContainerEnd>
where K2: Into<K>, 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<K, E, HashMap, Former, ContainerEnd> Debug for HashMapFormer<K, E, HashMap, Former, ContainerEnd>
where K: Debug + Eq + Hash, E: Debug, HashMap: Debug + HashMapLike<K, E> + Default, Former: Debug, ContainerEnd: Debug + Fn(&mut Former, Option<HashMap>),

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<K, E, HashMap, Former, ContainerEnd> Default for HashMapFormer<K, E, HashMap, Former, ContainerEnd>
where K: Default + Eq + Hash, E: Default, HashMap: Default + HashMapLike<K, E>, Former: Default, ContainerEnd: Default + Fn(&mut Former, Option<HashMap>),

Source§

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>
where Former: Freeze, ContainerEnd: Freeze, HashMap: Freeze,

§

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>
where Former: Send, ContainerEnd: Send, HashMap: Send, E: Send, K: Send,

§

impl<K, E, HashMap, Former, ContainerEnd> Sync for HashMapFormer<K, E, HashMap, Former, ContainerEnd>
where Former: Sync, ContainerEnd: Sync, HashMap: Sync, E: Sync, K: Sync,

§

impl<K, E, HashMap, Former, ContainerEnd> Unpin for HashMapFormer<K, E, HashMap, Former, ContainerEnd>
where Former: Unpin, ContainerEnd: Unpin, HashMap: Unpin, E: Unpin, K: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoResult<T> for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<Target, Original> VectorizedInto<Target> for Original
where Target: VectorizedFrom<Original>,

Source§

fn vectorized_into(self) -> Target

Performs the conversion.