[−][src]Struct iterpipes::Lazy
A "lazily" create pipe with an immutable state.
This pipe's behavior is defined by a callable object, for example a lambda expression, and can therefore be "lazily" created inline.
Since callable objects with an immutable state don't need to be reseted, reset
is a no-op.
Example
use iterpipes::*; let mut counter: u8 = 2; let mut pipe = Lazy::new(|i: u8| { i*counter }); assert_eq!(2, pipe.next(1)); assert_eq!(4, pipe.next(2));
Implementations
impl<I, O, F> Lazy<I, O, F> where
F: Fn(I) -> O,
[src]
F: Fn(I) -> O,
Trait Implementations
impl<I, O, F> Pipe for Lazy<I, O, F> where
F: Fn(I) -> O,
[src]
F: Fn(I) -> O,
type InputItem = I
The type of input this pipe accepts.
type OutputItem = O
The type of output this pipe produces.
fn next(&mut self, input: I) -> O
[src]
fn reset(&mut self)
[src]
fn bypass(self) -> Bypass<Self> where
Self: Sized,
Self::InputItem: Clone,
[src]
Self: Sized,
Self::InputItem: Clone,
fn compose(self) -> Composed<Self> where
Self: Sized,
[src]
Self: Sized,
fn connect<O: Pipe<InputItem = Self::OutputItem>>(
self,
other: O
) -> Connector<Self, O> where
Self: Sized,
[src]
self,
other: O
) -> Connector<Self, O> where
Self: Sized,
fn into_iter(self) -> IterPipe<Self> where
Self::InputItem: Default,
Self: Sized + Pipe<InputItem = ()>,
[src]
Self::InputItem: Default,
Self: Sized + Pipe<InputItem = ()>,
fn optional(self) -> Optional<Self> where
Self: Sized,
[src]
Self: Sized,
fn enumerate(self) -> Enumerate<Self> where
Self: Sized,
[src]
Self: Sized,
fn boxed(
self
) -> Box<dyn Pipe<InputItem = Self::InputItem, OutputItem = Self::OutputItem>> where
Self: Sized + 'static,
[src]
self
) -> Box<dyn Pipe<InputItem = Self::InputItem, OutputItem = Self::OutputItem>> where
Self: Sized + 'static,
Auto Trait Implementations
impl<I, O, F> RefUnwindSafe for Lazy<I, O, F> where
F: RefUnwindSafe,
I: RefUnwindSafe,
O: RefUnwindSafe,
F: RefUnwindSafe,
I: RefUnwindSafe,
O: RefUnwindSafe,
impl<I, O, F> Send for Lazy<I, O, F> where
F: Send,
I: Send,
O: Send,
F: Send,
I: Send,
O: Send,
impl<I, O, F> Sync for Lazy<I, O, F> where
F: Sync,
I: Sync,
O: Sync,
F: Sync,
I: Sync,
O: Sync,
impl<I, O, F> Unpin for Lazy<I, O, F> where
F: Unpin,
I: Unpin,
O: Unpin,
F: Unpin,
I: Unpin,
O: Unpin,
impl<I, O, F> UnwindSafe for Lazy<I, O, F> where
F: UnwindSafe,
I: UnwindSafe,
O: UnwindSafe,
F: UnwindSafe,
I: UnwindSafe,
O: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,