Struct Connector

Source
pub struct Connector<P0, P1>
where P0: Pipe, P1: Pipe<InputItem = P0::OutputItem>,
{ /* private fields */ }
Expand description

A pipe that connects two other pipes together.

The input item of this connector is the input item of P0 and its output item is the output item of P1. It calculates the output item of P0 and feeds it directly into P1.

Obviously, the output item of P0 has to match the input item of P1.

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

Implementations§

Source§

impl<P0, P1> Connector<P0, P1>
where P0: Pipe, P1: Pipe<InputItem = P0::OutputItem>,

Source

pub fn new(pipe0: P0, pipe1: P1) -> Self

Create a new connector with the two pipes.

Trait Implementations§

Source§

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

Source§

type InputItem = <P0 as Pipe>::InputItem

The type of input this pipe accepts.
Source§

type OutputItem = <P1 as Pipe>::OutputItem

The type of output this pipe produces.
Source§

fn next(&mut self, input: Self::InputItem) -> Self::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<P0, P1> ResetablePipe for Connector<P0, P1>
where P0: ResetablePipe, P1: ResetablePipe<InputItem = P0::OutputItem>,

Source§

fn reset(&mut self)

Reset the state of the pipe. Read more

Auto Trait Implementations§

§

impl<P0, P1> Freeze for Connector<P0, P1>
where P0: Freeze, P1: Freeze,

§

impl<P0, P1> RefUnwindSafe for Connector<P0, P1>

§

impl<P0, P1> Send for Connector<P0, P1>
where P0: Send, P1: Send,

§

impl<P0, P1> Sync for Connector<P0, P1>
where P0: Sync, P1: Sync,

§

impl<P0, P1> Unpin for Connector<P0, P1>
where P0: Unpin, P1: Unpin,

§

impl<P0, P1> UnwindSafe for Connector<P0, P1>
where P0: UnwindSafe, P1: 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.