[−][src]Struct libp2p::core::nodes::collection::PeerMut
Access to a peer in the collection.
Methods
impl<'a, TInEvent, TUserData, TConnInfo, TPeerId> PeerMut<'a, TInEvent, TUserData, TConnInfo, TPeerId>
[src]
impl<'a, TInEvent, TUserData, TConnInfo, TPeerId> PeerMut<'a, TInEvent, TUserData, TConnInfo, TPeerId> where
TConnInfo: ConnectionInfo<PeerId = TPeerId>,
TPeerId: Eq + Hash,
[src]
TConnInfo: ConnectionInfo<PeerId = TPeerId>,
TPeerId: Eq + Hash,
pub fn id(&self) -> &TPeerId
[src]
Returns the identity of the peer.
pub fn user_data(&self) -> &TUserData
[src]
Returns the user data that was stored in the collections when we accepted the connection.
pub fn user_data_mut(&mut self) -> &mut TUserData
[src]
Returns the user data that was stored in the collections when we accepted the connection.
pub fn start_send_event(&mut self, event: TInEvent)
[src]
Begin sending an event to the given node. Must be called only after a successful call to
poll_ready_event
.
pub fn poll_ready_event(&mut self, cx: &mut Context) -> Poll<()>
[src]
Make sure we are ready to accept an event to be sent with start_send_event
.
pub fn close(self) -> TUserData
[src]
Closes the connections to this node. Returns the user data.
No further event will be generated for this node.
pub fn start_take_over(
&mut self,
id: InterruptedReachAttempt<TInEvent, TConnInfo, TUserData>
)
[src]
&mut self,
id: InterruptedReachAttempt<TInEvent, TConnInfo, TUserData>
)
Gives ownership of a closed reach attempt. As soon as the connection to the peer (self
)
has some acknowledgment from the remote that its connection is alive, it will close the
connection inside id
.
The reach attempt will only be effectively cancelled once the peer (the object you're manipulating) has received some network activity. However no event will be ever be generated from this reach attempt, and this takes effect immediately.
#[must_use]
pub fn poll_ready_take_over(&mut self, cx: &mut Context) -> Poll<()>
[src]
Make sure we are ready to taking over with start_take_over
.
Auto Trait Implementations
impl<'a, TInEvent, TUserData, TConnInfo = PeerId, TPeerId = PeerId> !RefUnwindSafe for PeerMut<'a, TInEvent, TUserData, TConnInfo, TPeerId>
impl<'a, TInEvent, TUserData, TConnInfo, TPeerId> Send for PeerMut<'a, TInEvent, TUserData, TConnInfo, TPeerId> where
TConnInfo: Send,
TInEvent: Send,
TPeerId: Send,
TUserData: Send,
TConnInfo: Send,
TInEvent: Send,
TPeerId: Send,
TUserData: Send,
impl<'a, TInEvent, TUserData, TConnInfo, TPeerId> Sync for PeerMut<'a, TInEvent, TUserData, TConnInfo, TPeerId> where
TConnInfo: Sync,
TInEvent: Send,
TPeerId: Sync,
TUserData: Sync,
TConnInfo: Sync,
TInEvent: Send,
TPeerId: Sync,
TUserData: Sync,
impl<'a, TInEvent, TUserData, TConnInfo, TPeerId> Unpin for PeerMut<'a, TInEvent, TUserData, TConnInfo, TPeerId>
impl<'a, TInEvent, TUserData, TConnInfo = PeerId, TPeerId = PeerId> !UnwindSafe for PeerMut<'a, TInEvent, TUserData, TConnInfo, TPeerId>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,