Skip to main content

Epic

Trait Epic 

Source
pub trait Epic<A, S, C> {
    // Required method
    fn epic(
        &mut self,
        actions: &Actions<A, S, C>,
        action: &A,
        state: &S,
        context: &C,
    ) -> Option<impl Stream<Item = Result<A, Error>> + Send + 'static>;

    // Provided method
    fn is_terminated(&self) -> bool { ... }
}
Expand description

Epic.

Defines side effects for actions which will produce other actions over time.

Required Methods§

Source

fn epic( &mut self, actions: &Actions<A, S, C>, action: &A, state: &S, context: &C, ) -> Option<impl Stream<Item = Result<A, Error>> + Send + 'static>

Run the epic.

§Arguments
  • state: The state after the action has been applied.

Provided Methods§

Source

fn is_terminated(&self) -> bool

Whether this epic is terminated and should be not be called futher.

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<A, S, C> Epic<A, S, C> for MergeEpic<A, S, C>
where A: Send + 'static,

Source§

impl<A, S, C> Epic<A, S, C> for TracingEpic
where A: Debug + Send + 'static, S: Debug + Send + 'static,

Source§

impl<A, S, C, O, F> Epic<A, S, C> for F
where O: Stream<Item = Result<A, Error>> + Send + 'static, F: FnMut(&Actions<A, S, C>, &A, &S, &C) -> Option<O>,

Fn impl for epics.

Source§

impl<E1, E2, A, S, C> Epic<A, S, C> for JoinEpic<E1, E2>
where A: Send + 'static, E1: Epic<A, S, C>, E2: Epic<A, S, C>,

Source§

impl<E, A, S, C> Epic<A, S, C> for SwitchEpic<E>
where E: Epic<A, S, C>, A: Debug + Send + 'static, S: Debug + Send + 'static,