Skip to main content

Transport

Trait Transport 

Source
pub trait Transport:
    Send
    + Sync
    + 'static {
    // Required methods
    fn send<'life0, 'life1, 'async_trait>(
        &'life0 self,
        target_node: &'life1 NodeId,
        envelope: WireEnvelope,
    ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn send_request<'life0, 'life1, 'async_trait>(
        &'life0 self,
        target_node: &'life1 NodeId,
        envelope: WireEnvelope,
    ) -> Pin<Box<dyn Future<Output = Result<WireEnvelope, TransportError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn is_reachable<'life0, 'life1, 'async_trait>(
        &'life0 self,
        node: &'life1 NodeId,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Abstract transport for sending WireEnvelopes between nodes.

The Transport trait is the message-level abstraction — it defines how nodes exchange WireEnvelopes. It does not own connection management, handshakes, or address resolution.

§Who Implements Transport

Neither dactor core nor adapters implement this trait. The user or the underlying actor framework provider (ractor, kameo, coerce) supplies the Transport implementation. dactor only defines the trait interface.

§Version Handshake

Version handshakes are not part of the Transport trait. They are performed by adapter system actors (native ractor/kameo/coerce actors) that exchange HandshakeRequest/HandshakeResponse messages through the normal WireEnvelope path. This keeps the Transport focused on message delivery, while the framework handles version negotiation.

See docs/version-compatibility.md for the three-tier handshake detection strategy.

Required Methods§

Source

fn send<'life0, 'life1, 'async_trait>( &'life0 self, target_node: &'life1 NodeId, envelope: WireEnvelope, ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send a wire envelope to a remote node (fire-and-forget).

Source

fn send_request<'life0, 'life1, 'async_trait>( &'life0 self, target_node: &'life1 NodeId, envelope: WireEnvelope, ) -> Pin<Box<dyn Future<Output = Result<WireEnvelope, TransportError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send a wire envelope and wait for a reply envelope (for ask / stream).

Source

fn is_reachable<'life0, 'life1, 'async_trait>( &'life0 self, node: &'life1 NodeId, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a node is reachable.

Implementors§