pub struct CollectionStream<TInEvent, TOutEvent, THandler, TReachErr, THandlerErr> { /* private fields */ }
Expand description

Implementation of Stream that handles a collection of nodes.

Implementations

Creates a new empty collection.

Adds to the collection a future that tries to reach a remote.

This method spawns a task dedicated to resolving this future and processing the node’s events.

Interrupts a reach attempt.

Returns Ok if something was interrupted, and Err if the ID is not or no longer valid.

Sends an event to all nodes.

Grants access to an object that allows controlling a peer of the collection.

Returns None if we don’t have a connection to this peer.

Returns true if we are connected to the given peer.

This will return true only after a NodeReached event has been produced by poll().

Returns a list of all the active connections.

Does not include reach attempts that haven’t reached any target yet.

Provides an API similar to Stream, except that it cannot error.

Note: we use a regular poll method instead of implementing Stream in order to remove the Err variant, but also because we want the CollectionStream to stay borrowed if necessary.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.