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]
&self
) -> Box<dyn ProtocolHandler<Info = ProtocolId> + 'static + Sync + Send, Global>
Returns the trait object of the ProtocolHandler, which can be used by Swarm to construct the protocol muxer.
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.
Implementors
impl ProtocolImpl for FloodSub
[src]
pub fn handler(
&self
) -> Box<dyn ProtocolHandler<Info = ProtocolId> + 'static + Sync + Send, Global>
[src]
&self
) -> Box<dyn ProtocolHandler<Info = ProtocolId> + 'static + Sync + Send, Global>
pub fn start(self, swarm: Control) -> Option<TaskHandle<()>>
[src]
impl ProtocolImpl for DummyProtocol
[src]
pub fn handler(
&self
) -> Box<dyn ProtocolHandler<Info = ProtocolId> + 'static + Sync + Send, Global>
[src]
&self
) -> Box<dyn ProtocolHandler<Info = ProtocolId> + 'static + Sync + Send, Global>
impl<TStore> ProtocolImpl for Kademlia<TStore> where
TStore: for<'a> RecordStore<'a> + Send + 'static,
[src]
TStore: for<'a> RecordStore<'a> + Send + 'static,