NodeHandlerWrapper

Struct NodeHandlerWrapper 

Source
pub struct NodeHandlerWrapper<TProtoHandler>
where TProtoHandler: ProtocolsHandler,
{ /* private fields */ }
Expand description

Wraps around an implementation of ProtocolsHandler, and implements NodeHandler.

Trait Implementations§

Source§

impl<TProtoHandler> ConnectionHandler for NodeHandlerWrapper<TProtoHandler>
where TProtoHandler: ProtocolsHandler,

Source§

type InEvent = <TProtoHandler as ProtocolsHandler>::InEvent

The inbound type of events used to notify the handler through the Network. Read more
Source§

type OutEvent = <TProtoHandler as ProtocolsHandler>::OutEvent

The outbound type of events that the handler emits to the Network through ConnectionHandler::poll. Read more
Source§

type Error = NodeHandlerWrapperError<<TProtoHandler as ProtocolsHandler>::Error>

The type of errors that the handler can produce when polled by the Network.
Source§

type Substream = SubstreamRef<Arc<StreamMuxerBox>>

The type of the substream containing the data.
Source§

type OutboundOpenInfo = (u64, <TProtoHandler as ProtocolsHandler>::OutboundOpenInfo, Duration)

Information about a substream. Can be sent to the handler through a SubstreamEndpoint, and will be passed back in inject_substream or inject_outbound_closed.
Source§

fn inject_substream( &mut self, substream: Self::Substream, endpoint: SubstreamEndpoint<Self::OutboundOpenInfo>, )

Sends a new substream to the handler. Read more
Source§

fn inject_event(&mut self, event: Self::InEvent)

Notifies the handler of an event.
Source§

fn inject_address_change(&mut self, new_address: &Multiaddr)

Notifies the handler of a change in the address of the remote.
Source§

fn poll( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<ConnectionHandlerEvent<Self::OutboundOpenInfo, Self::OutEvent>, Self::Error>>

Polls the handler for events. Read more

Auto Trait Implementations§

§

impl<TProtoHandler> !Freeze for NodeHandlerWrapper<TProtoHandler>

§

impl<TProtoHandler> !RefUnwindSafe for NodeHandlerWrapper<TProtoHandler>

§

impl<TProtoHandler> Send for NodeHandlerWrapper<TProtoHandler>

§

impl<TProtoHandler> Sync for NodeHandlerWrapper<TProtoHandler>

§

impl<TProtoHandler> Unpin for NodeHandlerWrapper<TProtoHandler>
where TProtoHandler: Unpin, <TProtoHandler as ProtocolsHandler>::OutboundProtocol: Unpin,

§

impl<TProtoHandler> !UnwindSafe for NodeHandlerWrapper<TProtoHandler>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoConnectionHandler for T

Source§

type Handler = T

The node handler.
Source§

fn into_handler(self, _: &Connected) -> T

Builds the node handler. Read more
Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,