Trait ockam_transport_core::Transport
source · pub trait Transport: Send + Sync + 'static {
// Required methods
fn transport_type(&self) -> TransportType;
fn resolve_address<'life0, 'async_trait>(
&'life0 self,
address: Address
) -> Pin<Box<dyn Future<Output = Result<Address>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Generic representation of a Transport At minimum, a Transport must be able
- return its type
- instantiate workers for all the addresses with that transport type in a Route
Required Methods§
sourcefn transport_type(&self) -> TransportType
fn transport_type(&self) -> TransportType
Return the type of the Transport
sourcefn resolve_address<'life0, 'async_trait>(
&'life0 self,
address: Address
) -> Pin<Box<dyn Future<Output = Result<Address>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn resolve_address<'life0, 'async_trait>(
&'life0 self,
address: Address
) -> Pin<Box<dyn Future<Output = Result<Address>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Instantiate transport workers for in order to communicate with a remote address and return the local address of the transport worker