Struct Composed

Source
pub struct Composed<P>
where P: Pipe,
{ /* private fields */ }
Expand description

A composable or composed pipe.

This struct is an implementation of the newtype pattern to implement the >> operator for pipes (manifested as the Shr trait).

For more information, please see the documentation of the compose method.

Implementations§

Source§

impl<P> Composed<P>
where P: Pipe,

Source

pub fn new(pipe: P) -> Self

Create new composable or composed pipe.

Source

pub fn unwrap(self) -> P

Unwrap the inner pipe.

Trait Implementations§

Source§

impl<P> Pipe for Composed<P>
where P: Pipe,

Source§

type InputItem = <P as Pipe>::InputItem

The type of input this pipe accepts.
Source§

type OutputItem = <P as Pipe>::OutputItem

The type of output this pipe produces.
Source§

fn next(&mut self, item: P::InputItem) -> P::OutputItem

Calculate the next output item, based on an input item.
Source§

fn bypass(self) -> Bypass<Self>
where Self: Sized, Self::InputItem: Clone,

Create a bypassed version of the pipe. Read more
Source§

fn compose(self) -> Composed<Self>
where Self: Sized,

Create a composable pipe. Read more
Source§

fn connect<O: Pipe<InputItem = Self::OutputItem>>( self, other: O, ) -> Connector<Self, O>
where Self: Sized,

Connect two pipes. Read more
Source§

fn into_iter(self) -> IterPipe<Self>
where Self::InputItem: Default, Self: Sized + Pipe<InputItem = ()>,

Wrap the pipe into an iterator. Read more
Source§

fn optional(self) -> Optional<Self>
where Self: Sized,

Optionalize the pipe. Read more
Source§

fn enumerate(self) -> Enumerate<Self>
where Self: Sized,

Enumerate the output items of a pipe. Read more
Source§

fn boxed( self, ) -> Box<dyn Pipe<InputItem = Self::InputItem, OutputItem = Self::OutputItem>>
where Self: Sized + 'static,

Create a boxed trait object of the pipe. Read more
Source§

impl<P> ResetablePipe for Composed<P>
where P: ResetablePipe,

Source§

fn reset(&mut self)

Reset the state of the pipe. Read more
Source§

impl<P0, P1> Shr<P1> for Composed<P0>
where P0: Pipe, P1: Pipe<InputItem = P0::OutputItem>,

Source§

type Output = Composed<Connector<P0, P1>>

The resulting type after applying the >> operator.
Source§

fn shr(self, other: P1) -> Self::Output

Performs the >> operation. Read more

Auto Trait Implementations§

§

impl<P> Freeze for Composed<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for Composed<P>
where P: RefUnwindSafe,

§

impl<P> Send for Composed<P>
where P: Send,

§

impl<P> Sync for Composed<P>
where P: Sync,

§

impl<P> Unpin for Composed<P>
where P: Unpin,

§

impl<P> UnwindSafe for Composed<P>
where P: 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, 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.