pub trait Transport:
Send
+ Sync
+ 'static {
// Required methods
fn open_uni<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BoxSend>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn accept_uni<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BoxRecv>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn open_bi<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(BoxSend, BoxRecv)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn accept_bi<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(BoxSend, BoxRecv)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn close(&self, code: u32, reason: &[u8]);
// Provided methods
fn peer_label(&self) -> String { ... }
fn bytes_sent(&self) -> Option<u64> { ... }
}Required Methods§
Sourcefn open_uni<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BoxSend>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open_uni<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BoxSend>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Open a unidirectional stream for data frames.
Sourcefn accept_uni<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BoxRecv>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn accept_uni<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BoxRecv>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Accept the next unidirectional stream the peer opened.
Sourcefn open_bi<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(BoxSend, BoxRecv)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open_bi<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(BoxSend, BoxRecv)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Open the bidirectional control stream.
Provided Methods§
Sourcefn peer_label(&self) -> String
fn peer_label(&self) -> String
Human-readable peer identity, for logs.
Sourcefn bytes_sent(&self) -> Option<u64>
fn bytes_sent(&self) -> Option<u64>
Bytes already sent on this connection, if the transport tracks it. Used to report true wire throughput against post-compression volume.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".