pub trait AsConHnd: Debug + 'static + Send + Sync + Unpin {
    // Required methods
    fn uniq(&self) -> Uniq;
    fn dir(&self) -> Tx2ConDir;
    fn peer_addr(&self) -> Result<TxUrl, KitsuneError>;
    fn peer_cert(&self) -> Tx2Cert;
    fn is_closed(&self) -> bool;
    fn close(
        &self,
        code: u32,
        reason: &str
    ) -> Pin<Box<dyn Future<Output = ()> + Send, Global>>;
    fn write(
        &self,
        msg_id: MsgId,
        data: PoolBuf,
        timeout: KitsuneTimeout
    ) -> Pin<Box<dyn Future<Output = Result<(), KitsuneError>> + Send, Global>>;
}
Expand description

Trait representing a connection handle.

Required Methods§

source

fn uniq(&self) -> Uniq

Get the opaque Uniq identifier for this connection.

source

fn dir(&self) -> Tx2ConDir

Get the directionality of this connection.

source

fn peer_addr(&self) -> Result<TxUrl, KitsuneError>

Get the remote address of this connection.

source

fn peer_cert(&self) -> Tx2Cert

Get the certificate digest of the remote peer.

source

fn is_closed(&self) -> bool

Is this connection closed?

source

fn close( &self, code: u32, reason: &str ) -> Pin<Box<dyn Future<Output = ()> + Send, Global>>

Close this connection.

source

fn write( &self, msg_id: MsgId, data: PoolBuf, timeout: KitsuneTimeout ) -> Pin<Box<dyn Future<Output = Result<(), KitsuneError>> + Send, Global>>

Write data to this connection.

Implementors§