Skip to main content

ActorManager

Trait ActorManager 

Source
pub trait ActorManager {
    type Config;
    type Handle;

    // Required methods
    fn start<'async_trait>(
        config: Self::Config,
    ) -> Pin<Box<dyn Future<Output = ActorSystemResult<Self::Handle>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn stop<'async_trait>(
        handle: Self::Handle,
    ) -> Pin<Box<dyn Future<Output = ActorSystemResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn health_check<'life0, 'async_trait>(
        handle: &'life0 Self::Handle,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Actor管理器trait

定义了Actor的生命周期管理接口

Required Associated Types§

Required Methods§

Source

fn start<'async_trait>( config: Self::Config, ) -> Pin<Box<dyn Future<Output = ActorSystemResult<Self::Handle>> + Send + 'async_trait>>
where Self: 'async_trait,

启动Actor

Source

fn stop<'async_trait>( handle: Self::Handle, ) -> Pin<Box<dyn Future<Output = ActorSystemResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,

停止Actor

Source

fn health_check<'life0, 'async_trait>( handle: &'life0 Self::Handle, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

检查Actor是否健康

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§