Struct exocore_transport::p2p::Libp2pTransport
source · pub struct Libp2pTransport { /* private fields */ }
Expand description
Libp2p transport used by all services of Exocore through handles. There is one handle per cell per service.
The transport itself is scheduled on an Executor, and its future will complete as soon it’s ready. Once all handles are dropped, all its scheduled tasks will be stopped too.
Implementations§
source§impl Libp2pTransport
impl Libp2pTransport
sourcepub fn new(
local_node: LocalNode,
config: Libp2pTransportConfig
) -> Libp2pTransport
pub fn new( local_node: LocalNode, config: Libp2pTransportConfig ) -> Libp2pTransport
Creates a new transport for given node and config. The node is important here since all messages are authenticated using the node’s private key thanks to secio.
sourcepub fn get_handle(
&mut self,
cell: Cell,
service_type: ServiceType
) -> Result<Libp2pTransportServiceHandle, Error>
pub fn get_handle( &mut self, cell: Cell, service_type: ServiceType ) -> Result<Libp2pTransportServiceHandle, Error>
Creates sink and streams that can be used for a given service of a cell.
Auto Trait Implementations§
impl !RefUnwindSafe for Libp2pTransport
impl Send for Libp2pTransport
impl Sync for Libp2pTransport
impl Unpin for Libp2pTransport
impl !UnwindSafe for Libp2pTransport
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more