pub trait IncomingRemoteConnection {
// Required methods
fn accept_bi(
&self,
) -> impl Future<Output = Result<(SendStream, RecvStream), ConnectionError>> + Send;
fn close(&self, error_code: VarInt, reason: &[u8]);
fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>;
}Expand description
Abstracts over Connection and IncomingZeroRttConnection.
You don’t need to implement this trait yourself. It is used by read_request and
handle_connection to work with both fully authenticated connections and with
0-RTT connections.
Required Methods§
Sourcefn accept_bi(
&self,
) -> impl Future<Output = Result<(SendStream, RecvStream), ConnectionError>> + Send
fn accept_bi( &self, ) -> impl Future<Output = Result<(SendStream, RecvStream), ConnectionError>> + Send
Accepts a single bidirectional stream.
Sourcefn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>
Returns the remote’s endpoint id.
This may only fail for 0-RTT connections.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.