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§
Sourcefn 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<'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).
Sourcefn 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 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).