[−][src]Struct libp2p_core::nodes::raw_swarm::PeerNotConnected
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]
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,
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]
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,
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]
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,
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]
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,
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]
TTrans: Transport,
TPeerId: Debug,
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,
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]
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