pub trait MeshTransport:
Send
+ Sync
+ 'static {
// Required methods
fn name(&self) -> &str;
fn listen<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn TransportListener>, MeshError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn MeshStream>, MeshError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn supports(&self, addr: &str) -> bool;
}Expand description
Transport-agnostic mesh transport interface.
Implementations provide concrete connection semantics (QUIC, TCP, WebSocket, etc.) while the mesh layer stays transport-neutral.
Required Methods§
Sourcefn listen<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn TransportListener>, MeshError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn listen<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn TransportListener>, MeshError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Start listening for incoming connections on the given address.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".