Trait holochain::prelude::dependencies::kitsune_p2p_types::tx2::tx2_pool::AsEpHnd
source · pub trait AsEpHnd: 'static + Send + Sync + Unpin {
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 + 'static, Global>>;
fn close_connection(
&self,
remote: TxUrl,
code: u32,
reason: &str
) -> Pin<Box<dyn Future<Output = ()> + Send + 'static, Global>>;
fn get_connection(
&self,
remote: TxUrl,
timeout: KitsuneTimeout
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn AsConHnd + 'static>, KitsuneError>> + Send + 'static, Global>>;
fn write(
&self,
remote: TxUrl,
msg_id: MsgId,
data: PoolBuf,
timeout: KitsuneTimeout
) -> Pin<Box<dyn Future<Output = Result<(), KitsuneError>> + Send + 'static, Global>> { ... }
}
Expand description
Trait representing a connection handle.
Required Methods
sourcefn local_addr(&self) -> Result<TxUrl, KitsuneError>
fn local_addr(&self) -> Result<TxUrl, KitsuneError>
Get the bound local address of this endpoint.
sourcefn local_cert(&self) -> Tx2Cert
fn local_cert(&self) -> Tx2Cert
Get the local certificate digest.
sourcefn close(
&self,
code: u32,
reason: &str
) -> Pin<Box<dyn Future<Output = ()> + Send + 'static, Global>>
fn close(
&self,
code: u32,
reason: &str
) -> Pin<Box<dyn Future<Output = ()> + Send + 'static, Global>>
Close this endpoint.
sourcefn close_connection(
&self,
remote: TxUrl,
code: u32,
reason: &str
) -> Pin<Box<dyn Future<Output = ()> + Send + 'static, Global>>
fn close_connection(
&self,
remote: TxUrl,
code: u32,
reason: &str
) -> Pin<Box<dyn Future<Output = ()> + Send + 'static, Global>>
Force close a specific connection.
sourcefn get_connection(
&self,
remote: TxUrl,
timeout: KitsuneTimeout
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn AsConHnd + 'static>, KitsuneError>> + Send + 'static, Global>>
fn get_connection(
&self,
remote: TxUrl,
timeout: KitsuneTimeout
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn AsConHnd + 'static>, KitsuneError>> + Send + 'static, Global>>
Get a connection handle to an existing connection. If one does not exist, establish a new connection.