Trait kitsune_p2p_types::tx2::tx2_pool::AsConHnd
source · pub trait AsConHnd: Debug + 'static + Send + Sync + Unpin {
fn uniq(&self) -> Uniq;
fn dir(&self) -> Tx2ConDir;
fn peer_addr(&self) -> KitsuneResult<TxUrl>;
fn peer_cert(&self) -> Tx2Cert;
fn is_closed(&self) -> bool;
fn close(&self, code: u32, reason: &str) -> BoxFuture<'static, ()>;
fn write(
&self,
msg_id: MsgId,
data: PoolBuf,
timeout: KitsuneTimeout
) -> BoxFuture<'static, KitsuneResult<()>>;
}
Expand description
Trait representing a connection handle.
Required Methods§
sourcefn peer_addr(&self) -> KitsuneResult<TxUrl>
fn peer_addr(&self) -> KitsuneResult<TxUrl>
Get the remote address of this connection.
sourcefn write(
&self,
msg_id: MsgId,
data: PoolBuf,
timeout: KitsuneTimeout
) -> BoxFuture<'static, KitsuneResult<()>>
fn write(
&self,
msg_id: MsgId,
data: PoolBuf,
timeout: KitsuneTimeout
) -> BoxFuture<'static, KitsuneResult<()>>
Write data to this connection.