pub struct PeriodicIdHandler<TSubstream> { /* private fields */ }
Expand description
Protocol handler that identifies the remote at a regular period.
Implementations
sourceimpl<TSubstream> PeriodicIdHandler<TSubstream>
impl<TSubstream> PeriodicIdHandler<TSubstream>
Trait Implementations
sourceimpl<TSubstream> ProtocolsHandler for PeriodicIdHandler<TSubstream>where
TSubstream: AsyncRead + AsyncWrite,
impl<TSubstream> ProtocolsHandler for PeriodicIdHandler<TSubstream>where
TSubstream: AsyncRead + AsyncWrite,
type OutEvent = PeriodicIdHandlerEvent
type OutEvent = PeriodicIdHandlerEvent
Custom event that can be produced by the handler and that will be returned to the outside.
type Substream = TSubstream
type Substream = TSubstream
The type of the substream that contains the raw data.
type InboundProtocol = DeniedUpgrade
type InboundProtocol = DeniedUpgrade
The upgrade for the protocol or protocols handled by this handler.
type OutboundProtocol = IdentifyProtocolConfig
type OutboundProtocol = IdentifyProtocolConfig
The upgrade for the protocol or protocols handled by this handler.
type OutboundOpenInfo = ()
type OutboundOpenInfo = ()
Information about a substream. Can be sent to the handler through a
NodeHandlerEndpoint
,
and will be passed back in inject_substream
or inject_outbound_closed
. Read moresourcefn listen_protocol(&self) -> Self::InboundProtocol
fn listen_protocol(&self) -> Self::InboundProtocol
Produces a
ConnectionUpgrade
for the protocol or protocols to accept when listening. Read moresourcefn inject_fully_negotiated_inbound(&mut self, protocol: Void)
fn inject_fully_negotiated_inbound(&mut self, protocol: Void)
Injects a fully-negotiated substream in the handler. Read more
fn inject_fully_negotiated_outbound(
&mut self,
protocol: <Self::OutboundProtocol as OutboundUpgrade<TSubstream>>::Output,
_info: Self::OutboundOpenInfo
)
sourcefn inject_event(&mut self, _: Self::InEvent)
fn inject_event(&mut self, _: Self::InEvent)
Injects an event coming from the outside in the handler.
sourcefn inject_inbound_closed(&mut self)
fn inject_inbound_closed(&mut self)
Indicates to the handler that the inbound part of the muxer has been closed, and that
therefore no more inbound substreams will be produced. Read more
sourcefn inject_dial_upgrade_error(
&mut self,
_: Self::OutboundOpenInfo,
err: ProtocolsHandlerUpgrErr<<Self::OutboundProtocol as OutboundUpgrade<Self::Substream>>::Error>
)
fn inject_dial_upgrade_error(
&mut self,
_: Self::OutboundOpenInfo,
err: ProtocolsHandlerUpgrErr<<Self::OutboundProtocol as OutboundUpgrade<Self::Substream>>::Error>
)
Indicates to the handler that upgrading a substream to the given protocol has failed.
sourcefn shutdown(&mut self)
fn shutdown(&mut self)
Indicates to the node that it should shut down. After that, it is expected that
poll()
returns Ready(None)
as soon as possible. Read moresourcefn poll(
&mut self
) -> Poll<ProtocolsHandlerEvent<Self::OutboundProtocol, Self::OutboundOpenInfo, PeriodicIdHandlerEvent>, Self::Error>
fn poll(
&mut self
) -> Poll<ProtocolsHandlerEvent<Self::OutboundProtocol, Self::OutboundOpenInfo, PeriodicIdHandlerEvent>, Self::Error>
Should behave like
Stream::poll()
. Should close if no more event can be produced and the
node should be closed. Read moresourcefn map_in_event<TNewIn, TMap>(self, map: TMap) -> MapInEvent<Self, TNewIn, TMap>where
Self: Sized,
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
fn map_in_event<TNewIn, TMap>(self, map: TMap) -> MapInEvent<Self, TNewIn, TMap>where
Self: Sized,
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
Adds a closure that turns the input event into something else.
sourcefn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap>where
Self: Sized,
TMap: FnMut(Self::OutEvent) -> TNewOut,
fn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap>where
Self: Sized,
TMap: FnMut(Self::OutEvent) -> TNewOut,
Adds a closure that turns the output event into something else.
sourcefn select<TProto2>(self, other: TProto2) -> ProtocolsHandlerSelect<Self, TProto2>where
Self: Sized,
fn select<TProto2>(self, other: TProto2) -> ProtocolsHandlerSelect<Self, TProto2>where
Self: Sized,
Builds an implementation of
ProtocolsHandler
that handles both this protocol and the
other one together. Read moresourcefn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>where
Self: Sized,
fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>where
Self: Sized,
Creates a builder that will allow creating a
NodeHandler
that handles this protocol
exclusively. Read moresourcefn into_node_handler(self) -> NodeHandlerWrapper<Self>where
Self: Sized,
fn into_node_handler(self) -> NodeHandlerWrapper<Self>where
Self: Sized,
Builds an implementation of
NodeHandler
that handles this protocol exclusively. Read moreAuto Trait Implementations
impl<TSubstream> !RefUnwindSafe for PeriodicIdHandler<TSubstream>
impl<TSubstream> Send for PeriodicIdHandler<TSubstream>where
TSubstream: Send,
impl<TSubstream> Sync for PeriodicIdHandler<TSubstream>where
TSubstream: Sync,
impl<TSubstream> Unpin for PeriodicIdHandler<TSubstream>where
TSubstream: Unpin,
impl<TSubstream> !UnwindSafe for PeriodicIdHandler<TSubstream>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more