Trait meio::handlers::Consumer[][src]

pub trait Consumer<T: 'static>: Actor {
    fn handle<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        item: T,
        ctx: &'life1 mut Context<Self>
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn finished<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _ctx: &'life1 mut Context<Self>
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Send + 'async_trait
, { ... }
fn task_failed<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        err: TaskError,
        _ctx: &'life1 mut Context<Self>
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Send + 'async_trait
, { ... }
fn task_finished<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _ctx: &'life1 mut Context<Self>
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Send + 'async_trait
, { ... } }
Expand description

Represents a capability to receive message from a Stream.

Required methods

The method called when the next item received from a Stream.

If you need chunks here (group multiple items into chunks) than wrap your stream with ready_chunks method.

Provided methods

When the stream consumed completely.

Called after the last item in the stream only.

The stream was failed.

When the stream task was finished sucessfully.

You should prefer to use finished instead of this, because it’s service event with the high-priority and it can overtake ordinary stream items.

Implementors