Skip to main content

IncomingRemoteConnection

Trait IncomingRemoteConnection 

Source
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§

Source

fn accept_bi( &self, ) -> impl Future<Output = Result<(SendStream, RecvStream), ConnectionError>> + Send

Accepts a single bidirectional stream.

Source

fn close(&self, error_code: VarInt, reason: &[u8])

Close the connection.

Source

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.

Implementations on Foreign Types§

Source§

impl IncomingRemoteConnection for Connection

Source§

impl IncomingRemoteConnection for IncomingZeroRttConnection

Implementors§