[−][src]Struct libp2p_core::nodes::handled_node::HandledNode
A node combined with an implementation of NodeHandler.
Methods
impl<TMuxer, THandler> HandledNode<TMuxer, THandler> where
TMuxer: StreamMuxer,
THandler: NodeHandler<Substream = Substream<TMuxer>>, [src]
TMuxer: StreamMuxer,
THandler: NodeHandler<Substream = Substream<TMuxer>>,
pub fn new(muxer: TMuxer, handler: THandler) -> Self[src]
Builds a new HandledNode.
pub fn handler(&self) -> &THandler[src]
Returns a reference to the NodeHandler
pub fn handler_mut(&mut self) -> &mut THandler[src]
Returns a mutable reference to the NodeHandler
pub fn inject_event(&mut self, event: THandler::InEvent)[src]
Injects an event to the handler. Has no effect if the handler is closing.
pub fn is_remote_acknowledged(&self) -> bool[src]
Returns true if the remote has shown any sign of activity after the muxer has been open.
See StreamMuxer::is_remote_acknowledged.
ⓘImportant traits for Close<TMuxer>pub fn close(self) -> Close<TMuxer>[src]
ⓘImportant traits for Close<TMuxer>
Indicates to the handled node that it should shut down. After calling this method, the
Stream will end in the not-so-distant future.
pub fn poll(
self: Pin<&mut Self>,
cx: &mut Context
) -> Poll<Result<THandler::OutEvent, HandledNodeError<THandler::Error>>>[src]
self: Pin<&mut Self>,
cx: &mut Context
) -> Poll<Result<THandler::OutEvent, HandledNodeError<THandler::Error>>>
API similar to Future::poll that polls the node for events.
Trait Implementations
impl<TMuxer, THandler> Debug for HandledNode<TMuxer, THandler> where
TMuxer: StreamMuxer,
THandler: NodeHandler<Substream = Substream<TMuxer>> + Debug, [src]
TMuxer: StreamMuxer,
THandler: NodeHandler<Substream = Substream<TMuxer>> + Debug,
impl<TMuxer, THandler> Unpin for HandledNode<TMuxer, THandler> where
TMuxer: StreamMuxer,
THandler: NodeHandler<Substream = Substream<TMuxer>>, [src]
TMuxer: StreamMuxer,
THandler: NodeHandler<Substream = Substream<TMuxer>>,
Auto Trait Implementations
impl<TMuxer, THandler> RefUnwindSafe for HandledNode<TMuxer, THandler> where
THandler: RefUnwindSafe,
TMuxer: RefUnwindSafe,
<THandler as NodeHandler>::OutboundOpenInfo: RefUnwindSafe,
<TMuxer as StreamMuxer>::OutboundSubstream: RefUnwindSafe,
THandler: RefUnwindSafe,
TMuxer: RefUnwindSafe,
<THandler as NodeHandler>::OutboundOpenInfo: RefUnwindSafe,
<TMuxer as StreamMuxer>::OutboundSubstream: RefUnwindSafe,
impl<TMuxer, THandler> Send for HandledNode<TMuxer, THandler> where
THandler: Send,
TMuxer: Send + Sync,
<THandler as NodeHandler>::OutboundOpenInfo: Send,
<TMuxer as StreamMuxer>::OutboundSubstream: Send,
THandler: Send,
TMuxer: Send + Sync,
<THandler as NodeHandler>::OutboundOpenInfo: Send,
<TMuxer as StreamMuxer>::OutboundSubstream: Send,
impl<TMuxer, THandler> Sync for HandledNode<TMuxer, THandler> where
THandler: Sync,
TMuxer: Send + Sync,
<THandler as NodeHandler>::OutboundOpenInfo: Sync,
<TMuxer as StreamMuxer>::OutboundSubstream: Sync,
THandler: Sync,
TMuxer: Send + Sync,
<THandler as NodeHandler>::OutboundOpenInfo: Sync,
<TMuxer as StreamMuxer>::OutboundSubstream: Sync,
impl<TMuxer, THandler> UnwindSafe for HandledNode<TMuxer, THandler> where
THandler: UnwindSafe,
TMuxer: RefUnwindSafe,
<THandler as NodeHandler>::OutboundOpenInfo: RefUnwindSafe + UnwindSafe,
<TMuxer as StreamMuxer>::OutboundSubstream: RefUnwindSafe + UnwindSafe,
THandler: UnwindSafe,
TMuxer: RefUnwindSafe,
<THandler as NodeHandler>::OutboundOpenInfo: RefUnwindSafe + UnwindSafe,
<TMuxer as StreamMuxer>::OutboundSubstream: RefUnwindSafe + UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,