Trait Process

Source
pub trait Process {
    type Item;

    // Provided methods
    fn and_then<U, F>(self, f: F) -> AndThen<Self, U, F>
       where Self: Sized + 'static,
             U: Process + 'static,
             F: FnOnce(Self::Item) -> U + Clone + 'static { ... }
    fn map<B, F>(self, f: F) -> Map<Self, B, F>
       where Self: Sized + 'static,
             F: FnOnce(Self::Item) -> B + Clone + 'static { ... }
    fn zip<U>(self, other: U) -> Zip<Self, U>
       where Self: Sized + 'static,
             Self::Item: Clone,
             U: Process + Clone + 'static { ... }
    fn ap<U, B>(self, other: U) -> Ap<Self, U, B>
       where Self: Sized + 'static,
             Self::Item: FnOnce(U::Item) -> B + Clone,
             U: Process + Clone + 'static,
             B: 'static { ... }
    fn finally<U>(self, finalization: U) -> Finally<Self, U>
       where Self: Sized + 'static,
             Self::Item: Clone,
             U: Process<Item = ()> + Clone + 'static { ... }
    fn run(self) -> Run<Self>
       where Self: Process<Item = ()> + Sized { ... }
    fn run_using_id(self, pid: Grc<ProcessId>) -> Run<Self>
       where Self: Process<Item = ()> + Sized { ... }
    fn into_boxed(self) -> ProcessBox<Self::Item>
       where Self: Sized + Clone + 'static { ... }
}
Expand description

The computation based on continuations.

Required Associated Types§

Source

type Item

The type of the item that is used within the computation.

Provided Methods§

Source

fn and_then<U, F>(self, f: F) -> AndThen<Self, U, F>
where Self: Sized + 'static, U: Process + 'static, F: FnOnce(Self::Item) -> U + Clone + 'static,

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 + 'static, F: FnOnce(Self::Item) -> B + Clone + 'static,

Map the current computation using the specified transform.

Source

fn zip<U>(self, other: U) -> Zip<Self, U>
where Self: Sized + 'static, Self::Item: Clone, U: Process + Clone + 'static,

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 + 'static, Self::Item: FnOnce(U::Item) -> B + Clone, U: Process + Clone + 'static, B: 'static,

The function application.

Source

fn finally<U>(self, finalization: U) -> Finally<Self, U>
where Self: Sized + 'static, Self::Item: Clone, U: Process<Item = ()> + Clone + 'static,

Finalize the current computation regardless of canceling it or not.

Source

fn run(self) -> Run<Self>
where Self: Process<Item = ()> + Sized,

Run the Process computation.

Source

fn run_using_id(self, pid: Grc<ProcessId>) -> Run<Self>
where Self: Process<Item = ()> + Sized,

Run the Process computation using the specified process identifier.

Source

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

Convert into a boxed value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Process for Hold

Source§

impl Process for Id

Source§

impl Process for Passivate

Source§

impl Process for ProcessWithPriority

Source§

impl<F, M> Process for Delay<F, M>
where F: FnOnce() -> M + Clone + 'static, M: Process + 'static,

Source§

type Item = <M as Process>::Item

Source§

impl<F, M> Process for Loop<F, M>
where F: Fn() -> M + Clone + 'static, M: Process<Item = ()> + 'static,

Source§

type Item = <M as Process>::Item

Source§

impl<M> Process for EventIntoProcess<M>
where M: Event,

Source§

type Item = <M as Event>::Item

Source§

impl<M> Process for ParameterIntoProcess<M>
where M: Parameter,

Source§

type Item = <M as Parameter>::Item

Source§

impl<M> Process for SimulationIntoProcess<M>
where M: Simulation,

Source§

impl<M> Process for PassivateBefore<M>
where M: Event<Item = ()>,

Source§

impl<M> Process for Sequence<M>
where M: Process + Clone + 'static, M::Item: Clone,

Source§

type Item = List<<M as Process>::Item>

Source§

impl<M> Process for Sequence_<M>
where M: Process + Clone + 'static, M::Item: Clone,

Source§

impl<M> Process for Spawn<M>
where M: Process<Item = ()> + Clone + 'static,

Source§

impl<M> Process for SpawnUsingId<M>
where M: Process<Item = ()> + Clone + 'static,

Source§

impl<M> Process for Timeout<M>
where M: Process + Clone + 'static, M::Item: Clone,

Source§

impl<M> Process for TimeoutUsingId<M>
where M: Process + Clone + 'static, M::Item: Clone,

Source§

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

Source§

type Item = <M as Process>::Item

Source§

impl<M> Process for WhenCancelling<M>
where M: Observer<Message = (), Item = ()> + Clone + 'static,

Source§

impl<M, B, F> Process for Map<M, B, F>
where F: FnOnce(M::Item) -> B + Clone + 'static, M: Process + 'static, B: 'static,

Source§

type Item = B

Source§

impl<M, U> Process for Finally<M, U>
where M: Process + 'static, M::Item: Clone, U: Process<Item = ()> + Clone + 'static,

Source§

type Item = <M as Process>::Item

Source§

impl<M, U> Process for Zip<M, U>
where M: Process + 'static, M::Item: Clone, U: Process + Clone + 'static,

Source§

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

Source§

impl<M, U, B> Process for Ap<M, U, B>
where M: Process + 'static, U: Process + Clone + 'static, M::Item: FnOnce(U::Item) -> B + Clone, B: 'static,

Source§

type Item = B

Source§

impl<M, U, F> Process for AndThen<M, U, F>
where F: FnOnce(M::Item) -> U + Clone + 'static, M: Process + 'static, U: Process + 'static,

Source§

type Item = <U as Process>::Item

Source§

impl<O, M> Process for Await<O, M>
where O: Observable<Message = M>, M: Clone + 'static,

Source§

type Item = M

Source§

impl<O, M> Process for AwaitResult<O, M>
where O: Observable<Message = Result<M>>, M: Clone + 'static,

Source§

type Item = M

Source§

impl<S> Process for dvcompute_branch::simulation::resource::stats::Release<S>
where S: QueueStrategy,

Source§

impl<S> Process for dvcompute_branch::simulation::resource::stats::Request<S>
where S: QueueStrategy + Clone + 'static,

Source§

impl<S> Process for dvcompute_branch::simulation::resource::stats::RequestWithPriority<S>
where S: QueueStrategy + Clone + 'static, S::Priority: Clone,

Source§

impl<S> Process for dvcompute_branch::simulation::resource::Release<S>
where S: QueueStrategy,

Source§

impl<S> Process for dvcompute_branch::simulation::resource::Request<S>
where S: QueueStrategy + Clone + 'static,

Source§

impl<S> Process for dvcompute_branch::simulation::resource::RequestWithPriority<S>
where S: QueueStrategy + Clone + 'static, S::Priority: Clone,

Source§

impl<T> Process for Cancel<T>

Source§

type Item = T

Source§

impl<T> Process for EmbedResult<T>

Source§

type Item = T

Source§

impl<T> Process for Never<T>

Source§

type Item = T

Source§

impl<T> Process for Panic<T>

Source§

type Item = T

Source§

impl<T> Process for ProcessBox<T>

Source§

type Item = T

Source§

impl<T> Process for Return<T>

Source§

type Item = T

Source§

impl<T, M> Process for Transfer<T, M>
where M: Process<Item = ()>,

Source§

type Item = T