ParentMessenger

Trait ParentMessenger 

Source
pub trait ParentMessenger:
    Send
    + Sync
    + Debug {
    // Required methods
    fn send_message<'life0, 'async_trait>(
        &'life0 self,
        ctx: ParentRequestContext,
        message: ParentMessage,
    ) -> Pin<Box<dyn Future<Output = Result<MessageToParentResponse, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn request_spawn_child<'life0, 'async_trait>(
        &'life0 self,
        ctx: ParentRequestContext,
        request: SpawnChildRequest,
    ) -> Pin<Box<dyn Future<Output = Result<SpawnChildResponse, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn proxy_call<'life0, 'async_trait>(
        &'life0 self,
        ctx: ParentRequestContext,
        request: ProxyCallRequest,
    ) -> Pin<Box<dyn Future<Output = Result<ProxyCallResponse, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for sending messages to the parent process.

This is implemented by the IPC infrastructure and injected into child process routers to enable parent communication.

Required Methods§

Source

fn send_message<'life0, 'async_trait>( &'life0 self, ctx: ParentRequestContext, message: ParentMessage, ) -> Pin<Box<dyn Future<Output = Result<MessageToParentResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a message to the parent process.

Source

fn request_spawn_child<'life0, 'async_trait>( &'life0 self, ctx: ParentRequestContext, request: SpawnChildRequest, ) -> Pin<Box<dyn Future<Output = Result<SpawnChildResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Request that the parent spawn a child process owned by the caller.

Source

fn proxy_call<'life0, 'async_trait>( &'life0 self, ctx: ParentRequestContext, request: ProxyCallRequest, ) -> Pin<Box<dyn Future<Output = Result<ProxyCallResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Ask the workspace to proxy an IPC call to a specific child process.

Implementors§