[−][src]Struct libp2p::core::swarm::toggle::Toggle
Implementation of NetworkBehaviour
that can be either in the disabled or enabled state.
The state can only be chosen at initialization.
Trait Implementations
impl<TEvent, TBehaviour> NetworkBehaviourEventProcess<TEvent> for Toggle<TBehaviour> where
TBehaviour: NetworkBehaviourEventProcess<TEvent>,
[src]
TBehaviour: NetworkBehaviourEventProcess<TEvent>,
fn inject_event(&mut self, event: TEvent)
[src]
impl<TBehaviour> From<Option<TBehaviour>> for Toggle<TBehaviour>
[src]
impl<TBehaviour> NetworkBehaviour for Toggle<TBehaviour> where
TBehaviour: NetworkBehaviour,
[src]
TBehaviour: NetworkBehaviour,
type ProtocolsHandler = ToggleIntoProtoHandler<<TBehaviour as NetworkBehaviour>::ProtocolsHandler>
Handler for all the protocols the network supports.
type OutEvent = <TBehaviour as NetworkBehaviour>::OutEvent
Event generated by the swarm.
fn new_handler(
&mut self
) -> <Toggle<TBehaviour> as NetworkBehaviour>::ProtocolsHandler
[src]
&mut self
) -> <Toggle<TBehaviour> as NetworkBehaviour>::ProtocolsHandler
fn addresses_of_peer(&mut self, peer_id: &PeerId) -> Vec<Multiaddr>
[src]
fn inject_connected(&mut self, peer_id: PeerId, endpoint: ConnectedPoint)
[src]
fn inject_disconnected(&mut self, peer_id: &PeerId, endpoint: ConnectedPoint)
[src]
fn inject_replaced(
&mut self,
peer_id: PeerId,
closed_endpoint: ConnectedPoint,
new_endpoint: ConnectedPoint
)
[src]
&mut self,
peer_id: PeerId,
closed_endpoint: ConnectedPoint,
new_endpoint: ConnectedPoint
)
fn inject_node_event(
&mut self,
peer_id: PeerId,
event: <<<Toggle<TBehaviour> as NetworkBehaviour>::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::OutEvent
)
[src]
&mut self,
peer_id: PeerId,
event: <<<Toggle<TBehaviour> as NetworkBehaviour>::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::OutEvent
)
fn inject_addr_reach_failure(
&mut self,
peer_id: Option<&PeerId>,
addr: &Multiaddr,
error: &dyn Error
)
[src]
&mut self,
peer_id: Option<&PeerId>,
addr: &Multiaddr,
error: &dyn Error
)
fn inject_dial_failure(&mut self, peer_id: &PeerId)
[src]
fn poll(
&mut self,
params: &mut PollParameters
) -> Async<NetworkBehaviourAction<<<<Toggle<TBehaviour> as NetworkBehaviour>::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::InEvent, <Toggle<TBehaviour> as NetworkBehaviour>::OutEvent>>
[src]
&mut self,
params: &mut PollParameters
) -> Async<NetworkBehaviourAction<<<<Toggle<TBehaviour> as NetworkBehaviour>::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::InEvent, <Toggle<TBehaviour> as NetworkBehaviour>::OutEvent>>
Auto Trait Implementations
impl<TBehaviour> Send for Toggle<TBehaviour> where
TBehaviour: Send,
TBehaviour: Send,
impl<TBehaviour> Sync for Toggle<TBehaviour> where
TBehaviour: Sync,
TBehaviour: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
type Output = T
Should always be Self
impl<T> Erased for T
impl<T> Erased for T
impl<T> Typeable for T where
T: Any,
T: Any,