Trait vin_core::Task

source ·
pub trait Task {
    fn task<'async_trait>(
        self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait
; }
Expand description

Used to call arbitrary code on a task actor.

Note

Unlike normal [vin] actors, a task actor does not provide a way to hook into its lifetime with on_started() and on_closed() methods. This is because I can’t find a good way to supply the task future with a &mut self. If anyone figures out how to do it, submit a PR.

Required Methods§

Task function being executed.

Implementors§