[−][src]Struct libp2p::core::nodes::handled_node_tasks::HandledNodesTasks
Implementation of Stream
that handles a collection of nodes.
Methods
impl<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TConnInfo> HandledNodesTasks<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TConnInfo>
[src]
pub fn new(
) -> HandledNodesTasks<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TConnInfo>
[src]
) -> HandledNodesTasks<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TConnInfo>
Creates a new empty collection.
pub fn add_reach_attempt<TFut, TMuxer>(
&mut self,
future: TFut,
user_data: TUserData,
handler: TIntoHandler
) -> TaskId where
TConnInfo: Send + 'static,
TFut: Future<Item = (TConnInfo, TMuxer), Error = TReachErr> + Send + 'static,
THandlerErr: Error + Send + 'static,
TInEvent: Send + 'static,
TIntoHandler: IntoNodeHandler<TConnInfo> + Send + 'static,
TMuxer: StreamMuxer + Send + Sync + 'static,
TOutEvent: Send + 'static,
TReachErr: Error + Send + 'static,
<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler: NodeHandler,
<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler: Send,
<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler: 'static,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::OutboundOpenInfo: Send,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::OutboundOpenInfo: 'static,
<TMuxer as StreamMuxer>::OutboundSubstream: Send,
<TMuxer as StreamMuxer>::OutboundSubstream: 'static,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::Substream == SubstreamRef<Arc<TMuxer>>,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::InEvent == TInEvent,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::OutEvent == TOutEvent,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::Error == THandlerErr,
[src]
&mut self,
future: TFut,
user_data: TUserData,
handler: TIntoHandler
) -> TaskId where
TConnInfo: Send + 'static,
TFut: Future<Item = (TConnInfo, TMuxer), Error = TReachErr> + Send + 'static,
THandlerErr: Error + Send + 'static,
TInEvent: Send + 'static,
TIntoHandler: IntoNodeHandler<TConnInfo> + Send + 'static,
TMuxer: StreamMuxer + Send + Sync + 'static,
TOutEvent: Send + 'static,
TReachErr: Error + Send + 'static,
<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler: NodeHandler,
<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler: Send,
<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler: 'static,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::OutboundOpenInfo: Send,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::OutboundOpenInfo: 'static,
<TMuxer as StreamMuxer>::OutboundSubstream: Send,
<TMuxer as StreamMuxer>::OutboundSubstream: 'static,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::Substream == SubstreamRef<Arc<TMuxer>>,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::InEvent == TInEvent,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::OutEvent == TOutEvent,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::Error == THandlerErr,
Adds to the collection a future that tries to reach a node.
This method spawns a task dedicated to resolving this future and processing the node's events.
pub fn add_connection<TMuxer, THandler>(
&mut self,
user_data: TUserData,
muxer: TMuxer,
handler: THandler
) -> TaskId where
TConnInfo: Send + 'static,
THandler: NodeHandler<Substream = SubstreamRef<Arc<TMuxer>>, InEvent = TInEvent, OutEvent = TOutEvent, Error = THandlerErr> + Send + 'static,
THandlerErr: Error + Send + 'static,
TInEvent: Send + 'static,
TIntoHandler: IntoNodeHandler<TConnInfo, Handler = THandler> + Send + 'static,
TMuxer: StreamMuxer + Send + Sync + 'static,
TOutEvent: Send + 'static,
TReachErr: Error + Send + 'static,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::OutboundOpenInfo: Send,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::OutboundOpenInfo: 'static,
<TMuxer as StreamMuxer>::OutboundSubstream: Send,
<TMuxer as StreamMuxer>::OutboundSubstream: 'static,
[src]
&mut self,
user_data: TUserData,
muxer: TMuxer,
handler: THandler
) -> TaskId where
TConnInfo: Send + 'static,
THandler: NodeHandler<Substream = SubstreamRef<Arc<TMuxer>>, InEvent = TInEvent, OutEvent = TOutEvent, Error = THandlerErr> + Send + 'static,
THandlerErr: Error + Send + 'static,
TInEvent: Send + 'static,
TIntoHandler: IntoNodeHandler<TConnInfo, Handler = THandler> + Send + 'static,
TMuxer: StreamMuxer + Send + Sync + 'static,
TOutEvent: Send + 'static,
TReachErr: Error + Send + 'static,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::OutboundOpenInfo: Send,
<<TIntoHandler as IntoNodeHandler<TConnInfo>>::Handler as NodeHandler>::OutboundOpenInfo: 'static,
<TMuxer as StreamMuxer>::OutboundSubstream: Send,
<TMuxer as StreamMuxer>::OutboundSubstream: 'static,
Adds an existing connection to a node to the collection.
This method spawns a task dedicated to processing the node's events.
No NodeReached
event will be emitted for this task, since the node has already been
reached.
pub fn broadcast_event(&mut self, event: &TInEvent) where
TInEvent: Clone,
[src]
TInEvent: Clone,
Sends an event to all the tasks, including the pending ones.
pub fn task(&mut self, id: TaskId) -> Option<Task<TInEvent, TUserData>>
[src]
Grants access to an object that allows controlling a task of the collection.
Returns None
if the task id is invalid.
pub fn tasks(&'a self) -> impl Iterator<Item = TaskId> + 'a
[src]
Returns a list of all the active tasks.
pub fn poll(
&mut self
) -> Async<HandledNodesEvent<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TConnInfo>>
[src]
&mut self
) -> Async<HandledNodesEvent<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TConnInfo>>
Provides an API similar to Stream
, except that it cannot produce an error.
Trait Implementations
impl<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TConnInfo> Debug for HandledNodesTasks<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TConnInfo> where
TUserData: Debug,
[src]
TUserData: Debug,
Auto Trait Implementations
impl<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TConnInfo> Send for HandledNodesTasks<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TConnInfo> where
TConnInfo: Send,
THandlerErr: Send,
TInEvent: Send,
TIntoHandler: Send,
TOutEvent: Send,
TReachErr: Send,
TUserData: Send,
TConnInfo: Send,
THandlerErr: Send,
TInEvent: Send,
TIntoHandler: Send,
TOutEvent: Send,
TReachErr: Send,
TUserData: Send,
impl<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TConnInfo = PeerId> !Sync for HandledNodesTasks<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TConnInfo>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self