Trait libp2p_rs::swarm::protocol_handler::ProtocolImpl[][src]

pub trait ProtocolImpl {
    pub fn handler(
        &self
    ) -> Box<dyn ProtocolHandler<Info = ProtocolId> + 'static + Sync + Send, Global>; pub fn start(self, _swarm: Control) -> Option<TaskHandle<()>> { ... } }

Common trait for describing a Swarm friendly protocol.

Required methods

pub fn handler(
    &self
) -> Box<dyn ProtocolHandler<Info = ProtocolId> + 'static + Sync + Send, Global>
[src]

Returns the trait object of the ProtocolHandler, which can be used by Swarm to construct the protocol muxer.

Loading content...

Provided methods

pub fn start(self, _swarm: Control) -> Option<TaskHandle<()>>[src]

start() will consume the ownership and start the protocol. An optional task handle might be returned by start(), and it could be used to track the lifetime of the protocol.

Loading content...

Implementors

impl ProtocolImpl for FloodSub[src]

impl ProtocolImpl for DummyProtocol[src]

impl<TStore> ProtocolImpl for Kademlia<TStore> where
    TStore: for<'a> RecordStore<'a> + Send + 'static, 
[src]

Loading content...