VectorFormer

Struct VectorFormer 

Source
pub struct VectorFormer<E, Vector, Former, ContainerEnd>
where Vector: VectorLike<E> + Debug + PartialEq + Default, ContainerEnd: Fn(&mut Former, Option<Vector>),
{ /* private fields */ }
Expand description

Class for forming vector-like fields.

Implementations§

Source§

impl<E, Vector, Former, ContainerEnd> VectorFormer<E, Vector, Former, ContainerEnd>
where Vector: VectorLike<E> + Debug + PartialEq + Default, ContainerEnd: Fn(&mut Former, Option<Vector>),

Source

pub fn new( former: Former, container: Option<Vector>, on_end: ContainerEnd, ) -> VectorFormer<E, Vector, Former, ContainerEnd>

Make a new VectorFormer. It should be called by a former generated for your structure.

Source

pub fn replace( self, vector: Vector, ) -> VectorFormer<E, Vector, 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 push<E2>(self, e: E2) -> VectorFormer<E, Vector, Former, ContainerEnd>
where E2: Into<E>,

Appends an element to the back of a container. Make a new container if it was not made so far.

Trait Implementations§

Source§

impl<E, Vector, Former, ContainerEnd> Debug for VectorFormer<E, Vector, Former, ContainerEnd>
where E: Debug, Vector: Debug + VectorLike<E> + PartialEq + Default, Former: Debug, ContainerEnd: Debug + Fn(&mut Former, Option<Vector>),

Source§

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

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

impl<E, Vector, Former, ContainerEnd> Default for VectorFormer<E, Vector, Former, ContainerEnd>
where E: Default, Vector: Default + VectorLike<E> + Debug + PartialEq, Former: Default, ContainerEnd: Default + Fn(&mut Former, Option<Vector>),

Source§

fn default() -> VectorFormer<E, Vector, Former, ContainerEnd>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<E, Vector, Former, ContainerEnd> Freeze for VectorFormer<E, Vector, Former, ContainerEnd>
where Former: Freeze, ContainerEnd: Freeze, Vector: Freeze,

§

impl<E, Vector, Former, ContainerEnd> RefUnwindSafe for VectorFormer<E, Vector, Former, ContainerEnd>
where Former: RefUnwindSafe, ContainerEnd: RefUnwindSafe, Vector: RefUnwindSafe, E: RefUnwindSafe,

§

impl<E, Vector, Former, ContainerEnd> Send for VectorFormer<E, Vector, Former, ContainerEnd>
where Former: Send, ContainerEnd: Send, Vector: Send, E: Send,

§

impl<E, Vector, Former, ContainerEnd> Sync for VectorFormer<E, Vector, Former, ContainerEnd>
where Former: Sync, ContainerEnd: Sync, Vector: Sync, E: Sync,

§

impl<E, Vector, Former, ContainerEnd> Unpin for VectorFormer<E, Vector, Former, ContainerEnd>
where Former: Unpin, ContainerEnd: Unpin, Vector: Unpin, E: Unpin,

§

impl<E, Vector, Former, ContainerEnd> UnwindSafe for VectorFormer<E, Vector, Former, ContainerEnd>
where Former: UnwindSafe, ContainerEnd: UnwindSafe, Vector: UnwindSafe, E: 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.