pub struct RawSwarm<TTrans, TInEvent, TOutEvent, THandler, THandlerErr> where
TTrans: Transport, { /* fields omitted */ }
Implementation of Stream
that handles the nodes.
impl<TTrans, TInEvent, TOutEvent, TMuxer, THandler, THandlerErr> RawSwarm<TTrans, TInEvent, TOutEvent, THandler, THandlerErr> where TTrans: Transport + Clone, TMuxer: StreamMuxer, THandler: IntoNodeHandler + Send + 'static, THandler::Handler: NodeHandler<Substream = Substream<TMuxer>, InEvent = TInEvent, OutEvent = TOutEvent, Error = THandlerErr> + Send + 'static, <THandler::Handler as NodeHandler>::OutboundOpenInfo: Send + 'static, THandlerErr: Error + Send + 'static, | [src] |
Creates a new node events stream.
Returns the transport passed when building this object.
Start listening on the given multiaddress.
Returns an iterator that produces the list of addresses we're listening on.
Call this function in order to know which address remotes should dial in order to access
your local node.
observed_addr
should be an address a remote observes you as, which can be obtained for
example with the identify protocol.
For each listener, calls nat_traversal
with the observed address and returns the outcome.
Returns the peer id of the local node.
This is the same value as was passed to new()
.
pub fn dial( &mut self, addr: Multiaddr, handler: THandler ) -> Result<(), TransportError<TTrans::Error>> where TTrans: Transport<Output = (PeerId, TMuxer)>, TTrans::Error: Send + 'static, TTrans::Dial: Send + 'static, TMuxer: StreamMuxer + Send + Sync + 'static, TMuxer::OutboundSubstream: Send, TMuxer::Substream: Send, TInEvent: Send + 'static, TOutEvent: Send + 'static, | [src] |
Dials a multiaddress without knowing the peer ID we're going to obtain.
The second parameter is the handler to use if we manage to reach a node.
Deprecated:
Use incoming_negotiated().count() instead
Returns the number of incoming connections that are currently in the process of being
negotiated.
We don't know anything about these connections yet, so all we can do is know how many of
them we have.
Returns the list of incoming connections that are currently in the process of being
negotiated. We don't know the PeerId
of these nodes yet.
Sends an event to all nodes.
pub fn peer( &mut self, peer_id: PeerId ) -> Peer<TTrans, TInEvent, TOutEvent, THandler, THandlerErr> | [src] |
Grants access to a struct that represents a peer.
pub fn poll( &mut self ) -> Async<RawSwarmEvent<TTrans, TInEvent, TOutEvent, THandler, THandlerErr>> where TTrans: Transport<Output = (PeerId, TMuxer)>, TTrans::Error: Send + 'static, TTrans::Dial: Send + 'static, TTrans::ListenerUpgrade: Send + 'static, TMuxer: StreamMuxer + Send + Sync + 'static, TMuxer::OutboundSubstream: Send, TMuxer::Substream: Send, TInEvent: Send + 'static, TOutEvent: Send + 'static, THandler: IntoNodeHandler + Send + 'static, THandler::Handler: NodeHandler<Substream = Substream<TMuxer>, InEvent = TInEvent, OutEvent = TOutEvent, Error = THandlerErr> + Send + 'static, <THandler::Handler as NodeHandler>::OutboundOpenInfo: Send + 'static, THandlerErr: Error + Send + 'static, | [src] |
Provides an API similar to Stream
, except that it cannot error.
impl<TTrans: Debug, TInEvent: Debug, TOutEvent: Debug, THandler: Debug, THandlerErr: Debug> Debug for RawSwarm<TTrans, TInEvent, TOutEvent, THandler, THandlerErr> where TTrans: Transport, TTrans::Error: Debug, | [src] |
Formats the value using the given formatter. Read more
impl<TTrans, TInEvent, TOutEvent, THandler, THandlerErr> Send for RawSwarm<TTrans, TInEvent, TOutEvent, THandler, THandlerErr> where THandler: Send, THandlerErr: Send, TInEvent: Send, TOutEvent: Send, TTrans: Send, <TTrans as Transport>::Error: Send, <TTrans as Transport>::Listener: Send, | |
impl<TTrans, TInEvent, TOutEvent, THandler, THandlerErr> !Sync for RawSwarm<TTrans, TInEvent, TOutEvent, THandler, THandlerErr> | |
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static