pub trait AsEpHnd: 'static + Send + Sync + Unpin {
fn debug(&self) -> Value;
fn uniq(&self) -> Uniq;
fn local_addr(&self) -> KitsuneResult<TxUrl>;
fn local_cert(&self) -> Tx2Cert;
fn is_closed(&self) -> bool;
fn close(&self, code: u32, reason: &str) -> BoxFuture<'static, ()>;
fn close_connection(
&self,
remote: TxUrl,
code: u32,
reason: &str
) -> BoxFuture<'static, ()>;
fn get_connection(
&self,
remote: TxUrl,
timeout: KitsuneTimeout
) -> BoxFuture<'static, KitsuneResult<ConHnd>>;
fn write(
&self,
remote: TxUrl,
msg_id: MsgId,
data: PoolBuf,
timeout: KitsuneTimeout
) -> BoxFuture<'static, KitsuneResult<()>> { ... }
}
Expand description
Trait representing a connection handle.
Required methods
fn local_addr(&self) -> KitsuneResult<TxUrl>
fn local_addr(&self) -> KitsuneResult<TxUrl>
Get the bound local address of this endpoint.
fn local_cert(&self) -> Tx2Cert
fn local_cert(&self) -> Tx2Cert
Get the local certificate digest.
Force close a specific connection.
fn get_connection(
&self,
remote: TxUrl,
timeout: KitsuneTimeout
) -> BoxFuture<'static, KitsuneResult<ConHnd>>
fn get_connection(
&self,
remote: TxUrl,
timeout: KitsuneTimeout
) -> BoxFuture<'static, KitsuneResult<ConHnd>>
Get a connection handle to an existing connection. If one does not exist, establish a new connection.
Provided methods
fn write(
&self,
remote: TxUrl,
msg_id: MsgId,
data: PoolBuf,
timeout: KitsuneTimeout
) -> BoxFuture<'static, KitsuneResult<()>>
fn write(
&self,
remote: TxUrl,
msg_id: MsgId,
data: PoolBuf,
timeout: KitsuneTimeout
) -> BoxFuture<'static, KitsuneResult<()>>
Write data to target remote.