Trait ProcMessageHandler

Source
pub trait ProcMessageHandler:
    Actor
    + Send
    + Sync {
    // Required methods
    fn joined<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        cx: &'life1 Context<'_, Self>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn state<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        cx: &'life1 Context<'_, Self>,
    ) -> Pin<Box<dyn Future<Output = Result<ProcState, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn spawn<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        cx: &'life1 Context<'_, Self>,
        actor_type: String,
        actor_name: String,
        params_data: Data,
        status_port: PortRef<Index>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn spawn_proc<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        cx: &'life1 Context<'_, Self>,
        env: Environment,
        world_id: WorldId,
        proc_ids: Vec<ProcId>,
        world_size: usize,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_supervision<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        cx: &'life1 Context<'_, Self>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn stop<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        cx: &'life1 Context<'_, Self>,
        timeout: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<ProcStopResult, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn snapshot<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        cx: &'life1 Context<'_, Self>,
    ) -> Pin<Box<dyn Future<Output = Result<ProcSnapshot, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn local_addr<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        cx: &'life1 Context<'_, Self>,
    ) -> Pin<Box<dyn Future<Output = Result<ChannelAddr, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn py_spy_dump<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        cx: &'life1 Context<'_, Self>,
        config: PySpyConfig,
    ) -> Pin<Box<dyn Future<Output = Result<StackTrace, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn handle<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        cx: &'life1 Context<'_, Self>,
        message: ProcMessage,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

The custom handler trait for this message type.

Required Methods§

Source

fn joined<'life0, 'life1, 'async_trait>( &'life0 mut self, cx: &'life1 Context<'_, Self>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The generated handler method for this enum variant.

Source

fn state<'life0, 'life1, 'async_trait>( &'life0 mut self, cx: &'life1 Context<'_, Self>, ) -> Pin<Box<dyn Future<Output = Result<ProcState, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The generated handler method for this enum variant.

Source

fn spawn<'life0, 'life1, 'async_trait>( &'life0 mut self, cx: &'life1 Context<'_, Self>, actor_type: String, actor_name: String, params_data: Data, status_port: PortRef<Index>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The generated handler method for this enum variant.

Source

fn spawn_proc<'life0, 'life1, 'async_trait>( &'life0 mut self, cx: &'life1 Context<'_, Self>, env: Environment, world_id: WorldId, proc_ids: Vec<ProcId>, world_size: usize, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The generated handler method for this enum variant.

Source

fn update_supervision<'life0, 'life1, 'async_trait>( &'life0 mut self, cx: &'life1 Context<'_, Self>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The generated handler method for this enum variant.

Source

fn stop<'life0, 'life1, 'async_trait>( &'life0 mut self, cx: &'life1 Context<'_, Self>, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<ProcStopResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The generated handler method for this enum variant.

Source

fn snapshot<'life0, 'life1, 'async_trait>( &'life0 mut self, cx: &'life1 Context<'_, Self>, ) -> Pin<Box<dyn Future<Output = Result<ProcSnapshot, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The generated handler method for this enum variant.

Source

fn local_addr<'life0, 'life1, 'async_trait>( &'life0 mut self, cx: &'life1 Context<'_, Self>, ) -> Pin<Box<dyn Future<Output = Result<ChannelAddr, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The generated handler method for this enum variant.

Source

fn py_spy_dump<'life0, 'life1, 'async_trait>( &'life0 mut self, cx: &'life1 Context<'_, Self>, config: PySpyConfig, ) -> Pin<Box<dyn Future<Output = Result<StackTrace, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The generated handler method for this enum variant.

Provided Methods§

Source

fn handle<'life0, 'life1, 'async_trait>( &'life0 mut self, cx: &'life1 Context<'_, Self>, message: ProcMessage, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handle the next message.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§