Trait Composite

Source
pub trait Composite {
    type Item;

    // Provided methods
    fn and_then<U, F>(self, f: F) -> AndThen<Self, U, F>
       where Self: Sized,
             U: Composite,
             F: FnOnce(Self::Item) -> U { ... }
    fn map<B, F>(self, f: F) -> Map<Self, B, F>
       where Self: Sized,
             F: FnOnce(Self::Item) -> B { ... }
    fn zip<U>(self, other: U) -> Zip<Self, U>
       where Self: Sized,
             U: Composite { ... }
    fn ap<U, B>(self, other: U) -> Ap<Self, U, B>
       where Self: Sized,
             Self::Item: FnOnce(U::Item) -> B,
             U: Composite { ... }
    fn into_boxed(self) -> CompositeBox<Self::Item>
       where Self: Sized + Clone + 'static { ... }
    fn run<D>(self, disposable: D) -> Run<Self, D>
       where Self: Sized,
             D: Disposable + Clone + 'static { ... }
    fn run_(self) -> Run_<Self>
       where Self: Sized { ... }
}
Expand description

The computation synchronized with the composite queue.

Required Associated Types§

Source

type Item

The type of the item that is returned in the current modeling time.

Provided Methods§

Source

fn and_then<U, F>(self, f: F) -> AndThen<Self, U, F>
where Self: Sized, U: Composite, F: FnOnce(Self::Item) -> U,

Bind the current computation with its continuation within the resulting computation.

Source

fn map<B, F>(self, f: F) -> Map<Self, B, F>
where Self: Sized, F: FnOnce(Self::Item) -> B,

Map the current computation using the specified transform.

Source

fn zip<U>(self, other: U) -> Zip<Self, U>
where Self: Sized, U: Composite,

Zip the current computation with another one within the resulting computation.

Source

fn ap<U, B>(self, other: U) -> Ap<Self, U, B>
where Self: Sized, Self::Item: FnOnce(U::Item) -> B, U: Composite,

The function application.

Source

fn into_boxed(self) -> CompositeBox<Self::Item>
where Self: Sized + Clone + 'static,

Convert into a boxed value.

Source

fn run<D>(self, disposable: D) -> Run<Self, D>
where Self: Sized, D: Disposable + Clone + 'static,

Run the computation by the specified initial Disposable object.

Source

fn run_(self) -> Run_<Self>
where Self: Sized,

Run the computation by ignoring Disposable objects.

Implementors§

Source§

impl<D> Composite for DisposableComposite<D>
where D: Disposable + Clone + 'static,

Source§

impl<F, M> Composite for Delay<F, M>
where F: FnOnce() -> M, M: Composite,

Source§

type Item = <M as Composite>::Item

Source§

impl<F, T> Composite for Cons<F, T>
where F: FnOnce(DisposableBox, &Point<'_>) -> Result<(T, DisposableBox)>,

Source§

type Item = T

Source§

impl<I, M> Composite for Sequence<I, M>
where I: Iterator<Item = M>, M: Composite,

Source§

type Item = Vec<<M as Composite>::Item>

Source§

impl<I, M> Composite for Sequence_<I, M>
where I: Iterator<Item = M>, M: Composite,

Source§

impl<M> Composite for EventIntoComposite<M>
where M: Event,

Source§

type Item = <M as Event>::Item

Source§

impl<M> Composite for ParameterIntoComposite<M>
where M: Parameter,

Source§

type Item = <M as Parameter>::Item

Source§

impl<M> Composite for SimulationIntoComposite<M>
where M: Simulation,

Source§

impl<M> Composite for Trace<M>
where M: Composite,

Source§

type Item = <M as Composite>::Item

Source§

impl<M, B, F> Composite for Map<M, B, F>
where M: Composite, F: FnOnce(M::Item) -> B,

Source§

type Item = B

Source§

impl<M, U> Composite for Zip<M, U>
where M: Composite, U: Composite,

Source§

type Item = (<M as Composite>::Item, <U as Composite>::Item)

Source§

impl<M, U, B> Composite for Ap<M, U, B>
where M: Composite, U: Composite, M::Item: FnOnce(U::Item) -> B,

Source§

type Item = B

Source§

impl<M, U, F> Composite for AndThen<M, U, F>
where M: Composite, U: Composite, F: FnOnce(M::Item) -> U,

Source§

type Item = <U as Composite>::Item

Source§

impl<T> Composite for CompositeBox<T>

Source§

type Item = T

Source§

impl<T> Composite for Return<T>

Source§

type Item = T