pub trait Task:
Check
+ Display
+ Send
+ Sync {
// Required methods
fn async_run<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TaskError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn task<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), TaskError>> + Send + 'async_trait>>
where Self: 'async_trait;
fn as_plain(&self) -> PlainActor;
// Provided methods
fn spawn(self) -> JoinHandle<Result<(), TaskError>>
where Self: Sized + 'static { ... }
fn name(&self) -> &'static str { ... }
}Expand description
Interface for running model components
Required Methods§
Sourcefn async_run<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TaskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn async_run<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TaskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn task<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), TaskError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn task<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), TaskError>> + Send + 'async_trait>>where
Self: 'async_trait,
Run the actor loop
fn as_plain(&self) -> PlainActor
Provided Methods§
Sourcefn spawn(self) -> JoinHandle<Result<(), TaskError>>where
Self: Sized + 'static,
fn spawn(self) -> JoinHandle<Result<(), TaskError>>where
Self: Sized + 'static,
Run the actor loop in a dedicated thread
fn name(&self) -> &'static str
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".