pub trait AsEpHnd: 'static + Send + Sync + Unpin {
    // Required methods
    fn debug(&self) -> Value;
    fn uniq(&self) -> Uniq;
    fn local_addr(&self) -> Result<TxUrl, KitsuneError>;
    fn local_cert(&self) -> Tx2Cert;
    fn is_closed(&self) -> bool;
    fn close(
        &self,
        code: u32,
        reason: &str
    ) -> Pin<Box<dyn Future<Output = ()> + Send>>;
    fn close_connection(
        &self,
        remote: TxUrl,
        code: u32,
        reason: &str
    ) -> Pin<Box<dyn Future<Output = ()> + Send>>;
    fn get_connection(
        &self,
        remote: TxUrl,
        timeout: KitsuneTimeout
    ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn AsConHnd>, KitsuneError>> + Send>>;

    // Provided method
    fn write(
        &self,
        remote: TxUrl,
        msg_id: MsgId,
        data: PoolBuf,
        timeout: KitsuneTimeout
    ) -> Pin<Box<dyn Future<Output = Result<(), KitsuneError>> + Send>> { ... }
}
Expand description

Trait representing a connection handle.

Required Methods§

source

fn debug(&self) -> Value

Capture a debugging internal state dump.

source

fn uniq(&self) -> Uniq

Get the opaque Uniq identifier for this endpoint.

source

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

Get the bound local address of this endpoint.

source

fn local_cert(&self) -> Tx2Cert

Get the local certificate digest.

source

fn is_closed(&self) -> bool

Is this endpoint closed?

source

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

Close this endpoint.

source

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

Force close a specific connection.

source

fn get_connection( &self, remote: TxUrl, timeout: KitsuneTimeout ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn AsConHnd>, KitsuneError>> + Send>>

Get a connection handle to an existing connection. If one does not exist, establish a new connection.

Provided Methods§

source

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

Write data to target remote.

Implementors§