Skip to main content

SystemMessageRouter

Trait SystemMessageRouter 

Source
pub trait SystemMessageRouter: Send + Sync {
    // Required method
    fn route_system_envelope<'life0, 'async_trait>(
        &'life0 self,
        envelope: WireEnvelope,
    ) -> Pin<Box<dyn Future<Output = Result<RoutingOutcome, RoutingError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Routes incoming WireEnvelope system messages to the correct native system actor mailbox.

Each adapter runtime implements this trait. The transport layer calls route_system_envelope for every incoming envelope whose message_type is a well-known system message type (see is_system_message_type).

System message bodies are deserialized using the fixed protobuf wire format (see proto). Application messages remain pluggable via MessageSerializer.

Required Methods§

Source

fn route_system_envelope<'life0, 'async_trait>( &'life0 self, envelope: WireEnvelope, ) -> Pin<Box<dyn Future<Output = Result<RoutingOutcome, RoutingError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Route a system message envelope to the appropriate system actor.

System message bodies are deserialized internally using protobuf — no external serializer is needed.

§Errors

Returns RoutingError if:

  • The message_type is not a recognized system message type
  • System actors have not been started yet
  • Deserialization of the protobuf body fails
  • The target system actor’s mailbox is closed

Implementors§