Skip to main content

Step

Struct Step 

Source
pub struct Step<D, P, T, ID> { /* private fields */ }
Expand description

Represent an active stage in the transformation pipeline.

Implementations§

Source§

impl<D, P, T, ID> Step<D, P, T, ID>

Source

pub fn step<NewD, T1, T2>( self, decorator: NewD, ) -> Step<NewD, Self, T1, StepIndex<ID>>
where NewD: Decorator<T1, T2>, D: Decorator<T, T1>,

Applies a transformation to the current value and potentially changes existing type

However, the transformation is lazy which means it only takes effect after you consume Step value. Typical step registrations would be simply stacked up to produce a chain of step pipeline.

Source

pub fn get_index(&self) -> usize
where ID: StepIndexBase,

Provide the depth for the current step. At any time you can query where the current step’s at.

Trait Implementations§

Source§

impl<D, P, T, ID, O> Collector<O> for Step<D, P, T, ID>
where D: Decorator<T, O>, P: Collector<T>,

Source§

fn collect(self) -> Result<O>

Finalizes the pipeline and returns the resulting value.

Auto Trait Implementations§

§

impl<D, P, T, ID> Freeze for Step<D, P, T, ID>
where D: Freeze, P: Freeze, ID: Freeze,

§

impl<D, P, T, ID> RefUnwindSafe for Step<D, P, T, ID>

§

impl<D, P, T, ID> Send for Step<D, P, T, ID>
where D: Send, P: Send, ID: Send, T: Send,

§

impl<D, P, T, ID> Sync for Step<D, P, T, ID>
where D: Sync, P: Sync, ID: Sync, T: Sync,

§

impl<D, P, T, ID> Unpin for Step<D, P, T, ID>
where D: Unpin, P: Unpin, ID: Unpin, T: Unpin,

§

impl<D, P, T, ID> UnsafeUnpin for Step<D, P, T, ID>

§

impl<D, P, T, ID> UnwindSafe for Step<D, P, T, ID>

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, 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.