[−][src]Struct iterpipes::Counter
A continous counter.
This pipe has an counter and a delta value. Every time next
is called, the current counter value is returned and the delta is added to the counter. It also knows it's starting value and can therefore be reseted.
Example
use iterpipes::*; let mut counter: Counter<u8> = Counter::new(1, 2); assert_eq!(1, counter.next(())); assert_eq!(3, counter.next(()));
Implementations
impl<T> Counter<T> where
T: AddAssign<T> + Copy,
[src]
T: AddAssign<T> + Copy,
Trait Implementations
impl<T> Pipe for Counter<T> where
T: AddAssign<T> + Copy,
[src]
T: AddAssign<T> + Copy,
type InputItem = ()
The type of input this pipe accepts.
type OutputItem = T
The type of output this pipe produces.
fn next(&mut self, _: ()) -> T
[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<T> RefUnwindSafe for Counter<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Counter<T> where
T: Send,
T: Send,
impl<T> Sync for Counter<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Counter<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Counter<T> where
T: UnwindSafe,
T: 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>,