Trait crossbus::message::MStream

source ·
pub trait MStream<Item>where
    Self: Actor,{
    // Provided methods
    fn started(&mut self, _: &mut Context<Self>) { ... }
    fn state(&mut self, _: &mut Context<Self>) -> MStreamingState { ... }
    fn spawn_mstream<S>(&mut self, ctx: &mut Context<Self>, stream: S)
       where Self: Actor<Message = S::Item> + MStream<S::Item>,
             S: CoreStream + 'static,
             S::Item: Message { ... }
    fn aborted(&mut self, _: &mut Context<Self>) { ... }
    fn paused(&mut self, _: &mut Context<Self>) { ... }
    fn resumed(&mut self, _: &mut Context<Self>) { ... }
    fn finished(&mut self, _: &mut Context<Self>) { ... }
}
Expand description

An abstraction for Actor’s message stream routine

Provided Methods§

source

fn started(&mut self, _: &mut Context<Self>)

called before the actor emit the first Strem Item

source

fn state(&mut self, _: &mut Context<Self>) -> MStreamingState

change the state of stream to abort/pause/resume the stream accordingly

Real-Time control or more elaborated execution could be achieved right here

source

fn spawn_mstream<S>(&mut self, ctx: &mut Context<Self>, stream: S)where Self: Actor<Message = S::Item> + MStream<S::Item>, S: CoreStream + 'static, S::Item: Message,

add stream to the actor

source

fn aborted(&mut self, _: &mut Context<Self>)

called after the actor aborts the stream

source

fn paused(&mut self, _: &mut Context<Self>)

called after the actor pause the stream

source

fn resumed(&mut self, _: &mut Context<Self>)

called after the actor resume the stream

source

fn finished(&mut self, _: &mut Context<Self>)

called after the actor send the last Strem Item

Implementors§