[][src]Struct libp2p_core::nodes::raw_swarm::PeerNotConnected

pub struct PeerNotConnected<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId> where
    TTrans: Transport
{ /* fields omitted */ }

Access to a peer we're not connected to.

Methods

impl<'a, TTrans, TInEvent, TOutEvent, TMuxer, THandler, THandlerErr, TConnInfo, TPeerId> PeerNotConnected<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId> where
    TTrans: Transport<Output = (TConnInfo, TMuxer)> + Clone,
    TTrans::Error: Send + 'static,
    TTrans::Dial: Send + 'static,
    TMuxer: StreamMuxer + Send + Sync + 'static,
    TMuxer::OutboundSubstream: Send,
    TMuxer::Substream: Send,
    THandler: IntoNodeHandler<(TConnInfo, ConnectedPoint)> + 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,
    TInEvent: Send + 'static,
    TOutEvent: Send + 'static, 
[src]

pub fn connect(
    self,
    addr: Multiaddr,
    handler: THandler
) -> PeerPendingConnect<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId> where
    TConnInfo: Debug + ConnectionInfo<PeerId = TPeerId> + Send + 'static,
    TPeerId: Eq + Hash + Clone + Send + 'static, 
[src]

Attempts a new connection to this node using the given multiaddress.

If we reach a peer but the PeerId doesn't correspond to the one we're expecting, then the whole connection is immediately closed.

pub fn connect_iter<TIter>(
    self,
    addrs: TIter,
    handler: THandler
) -> Result<PeerPendingConnect<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId>, Self> where
    TIter: IntoIterator<Item = Multiaddr>,
    TConnInfo: Debug + ConnectionInfo<PeerId = TPeerId> + Send + 'static,
    TPeerId: Eq + Hash + Clone + Send + 'static, 
[src]

Attempts a new connection to this node using the given multiaddresses.

The multiaddresses passed as parameter will be tried one by one.

Returns an error if the iterator is empty.

If we reach a peer but the PeerId doesn't correspond to the one we're expecting, then the whole connection is immediately closed.

pub fn inject_connection(
    self,
    conn_info: TConnInfo,
    connected_point: ConnectedPoint,
    muxer: TMuxer,
    handler: THandler::Handler
) -> PeerConnected<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId> where
    TConnInfo: Debug + ConnectionInfo<PeerId = TPeerId> + Clone + Send + 'static,
    TPeerId: Eq + Hash + Clone
[src]

Moves the given node to a connected state using the given connection info and muxer.

No Connected event is generated for this action.

Panic

Panics if conn_info.peer_id() is not the current peer.

Trait Implementations

impl<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId> Debug for PeerNotConnected<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId> where
    TTrans: Transport,
    TPeerId: Debug
[src]

Auto Trait Implementations

impl<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId> Send for PeerNotConnected<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId> where
    TConnInfo: Send,
    THandler: Send,
    THandlerErr: Send,
    TInEvent: Send,
    TOutEvent: Send,
    TPeerId: Send,
    TTrans: Send,
    <TTrans as Transport>::Error: Send,
    <TTrans as Transport>::Listener: Send

impl<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId> !Sync for PeerNotConnected<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self