Accum

Struct Accum 

Source
pub struct Accum<Acc, Input, C, F> { /* private fields */ }

Implementations§

Source§

impl<Acc, Input, C, F: FnMut(&mut Acc, Input)> Accum<Acc, Input, C, F>

Source

pub fn new(acc: Acc, f: F) -> Self

Trait Implementations§

Source§

impl<Acc: Clone, Input, C, F: FnMut(&mut Acc, Input)> StreamFunction for Accum<Acc, Input, C, F>

Source§

type Input = Input

Source§

type Output = Acc

Source§

type Clock = C

Source§

type Error = ()

Source§

fn step( &mut self, input: Self::Input, _: Self::Clock, ) -> Result<Self::Output, Self::Error>

Source§

fn map<U, F>(self, f: F) -> Map<Self, U>
where Self: Sized, F: 'static + Fn(Self::Output) -> U,

Source§

fn apply_to<Input, C, I: Iterator<Item = (Input, C)>>( self, iterator: I, ) -> Apply<I, Self>
where Self: Sized,

Source§

fn iter(self) -> Iter<Self>
where Self: Sized,

Source§

fn and_then<SF: StreamFunction<Input = Self::Output, Clock = Self::Clock, Error = Self::Error>>( self, sf: SF, ) -> Composition<Self, SF>
where Self: Sized,

Source§

fn parallel<SF: StreamFunction>(self, sf: SF) -> Parallel<Self, SF>
where Self: Sized,

Source§

fn fan_out<SF: StreamFunction<Input = Self::Input, Clock = Self::Clock, Error = Self::Error>>( self, sf: SF, ) -> FanOut<Self::Input, Self::Clock, Self::Error, Self, SF>
where Self: Sized, Self::Input: Clone, Self::Clock: Copy,

Auto Trait Implementations§

§

impl<Acc, Input, C, F> Freeze for Accum<Acc, Input, C, F>
where Acc: Freeze, F: Freeze,

§

impl<Acc, Input, C, F> RefUnwindSafe for Accum<Acc, Input, C, F>

§

impl<Acc, Input, C, F> Send for Accum<Acc, Input, C, F>
where Acc: Send, F: Send, Input: Send, C: Send,

§

impl<Acc, Input, C, F> Sync for Accum<Acc, Input, C, F>
where Acc: Sync, F: Sync, Input: Sync, C: Sync,

§

impl<Acc, Input, C, F> Unpin for Accum<Acc, Input, C, F>
where Acc: Unpin, F: Unpin, Input: Unpin, C: Unpin,

§

impl<Acc, Input, C, F> UnwindSafe for Accum<Acc, Input, C, F>
where Acc: UnwindSafe, F: UnwindSafe, Input: UnwindSafe, C: 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.