[−][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, TPeerId> HandledNodesTasks<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TPeerId>[src]
pub fn new() -> Self[src]
Creates a new empty collection.
pub fn add_reach_attempt<TFut, TMuxer>(
&mut self,
future: TFut,
user_data: TUserData,
handler: TIntoHandler
) -> TaskId where
TFut: Future<Item = (TPeerId, TMuxer), Error = TReachErr> + Send + 'static,
TIntoHandler: IntoNodeHandler<TPeerId> + Send + 'static,
TIntoHandler::Handler: NodeHandler<Substream = Substream<TMuxer>, InEvent = TInEvent, OutEvent = TOutEvent, Error = THandlerErr> + Send + 'static,
TReachErr: Error + Send + 'static,
THandlerErr: Error + Send + 'static,
TInEvent: Send + 'static,
TOutEvent: Send + 'static,
<TIntoHandler::Handler as NodeHandler>::OutboundOpenInfo: Send + 'static,
TMuxer: StreamMuxer + Send + Sync + 'static,
TMuxer::OutboundSubstream: Send + 'static,
TPeerId: Send + 'static, [src]
&mut self,
future: TFut,
user_data: TUserData,
handler: TIntoHandler
) -> TaskId where
TFut: Future<Item = (TPeerId, TMuxer), Error = TReachErr> + Send + 'static,
TIntoHandler: IntoNodeHandler<TPeerId> + Send + 'static,
TIntoHandler::Handler: NodeHandler<Substream = Substream<TMuxer>, InEvent = TInEvent, OutEvent = TOutEvent, Error = THandlerErr> + Send + 'static,
TReachErr: Error + Send + 'static,
THandlerErr: Error + Send + 'static,
TInEvent: Send + 'static,
TOutEvent: Send + 'static,
<TIntoHandler::Handler as NodeHandler>::OutboundOpenInfo: Send + 'static,
TMuxer: StreamMuxer + Send + Sync + 'static,
TMuxer::OutboundSubstream: Send + 'static,
TPeerId: Send + 'static,
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 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>(&'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, TPeerId>>[src]
&mut self
) -> Async<HandledNodesEvent<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TPeerId>>
Provides an API similar to Stream, except that it cannot produce an error.
Trait Implementations
impl<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TPeerId> Debug for HandledNodesTasks<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TPeerId> where
TUserData: Debug, [src]
TUserData: Debug,
Auto Trait Implementations
impl<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TPeerId> Send for HandledNodesTasks<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TPeerId> where
THandlerErr: Send,
TInEvent: Send,
TIntoHandler: Send,
TOutEvent: Send,
TPeerId: Send,
TReachErr: Send,
TUserData: Send,
THandlerErr: Send,
TInEvent: Send,
TIntoHandler: Send,
TOutEvent: Send,
TPeerId: Send,
TReachErr: Send,
TUserData: Send,
impl<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TPeerId = PeerId> !Sync for HandledNodesTasks<TInEvent, TOutEvent, TIntoHandler, TReachErr, THandlerErr, TUserData, TPeerId>
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