Trait holochain::prelude::kitsune_p2p::dependencies::kitsune_p2p_types::tx2::tx2_adapter::EndpointAdapt
source · pub trait EndpointAdapt: '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 connect(
&self,
url: TxUrl,
timeout: KitsuneTimeout
) -> Pin<Box<dyn Future<Output = Result<(Arc<dyn ConAdapt, Global>, Box<dyn InChanRecvAdapt<Item = Pin<Box<dyn Future<Output = Result<Box<dyn AsFramedReader, Global>, KitsuneError>> + Send, Global>>>, Global>), KitsuneError>> + Send, Global>>;
fn is_closed(&self) -> bool;
fn close(
&self,
code: u32,
reason: &str
) -> Pin<Box<dyn Future<Output = ()> + Send, Global>>;
}
Expand description
Tx backend adapter represents a bound local endpoint.
Required Methods§
sourcefn local_addr(&self) -> Result<TxUrl, KitsuneError>
fn local_addr(&self) -> Result<TxUrl, KitsuneError>
Get the string address (url) of this binding.
sourcefn local_cert(&self) -> Tx2Cert
fn local_cert(&self) -> Tx2Cert
Get the local certificate digest.
sourcefn connect(
&self,
url: TxUrl,
timeout: KitsuneTimeout
) -> Pin<Box<dyn Future<Output = Result<(Arc<dyn ConAdapt, Global>, Box<dyn InChanRecvAdapt<Item = Pin<Box<dyn Future<Output = Result<Box<dyn AsFramedReader, Global>, KitsuneError>> + Send, Global>>>, Global>), KitsuneError>> + Send, Global>>
fn connect( &self, url: TxUrl, timeout: KitsuneTimeout ) -> Pin<Box<dyn Future<Output = Result<(Arc<dyn ConAdapt, Global>, Box<dyn InChanRecvAdapt<Item = Pin<Box<dyn Future<Output = Result<Box<dyn AsFramedReader, Global>, KitsuneError>> + Send, Global>>>, Global>), KitsuneError>> + Send, Global>>
Create a new outgoing connection to a remote.