[−][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) -> StartSend<TInEvent, ()>
[src]
Sends an event to the given node.
pub fn complete_send_event(&mut self) -> Poll<(), ()>
[src]
Complete sending an event message initiated by 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.
#[must_use]
pub fn start_take_over(
&mut self,
id: InterruptedReachAttempt<TInEvent, TConnInfo, TUserData>
) -> StartTakeOver<(), InterruptedReachAttempt<TInEvent, TConnInfo, TUserData>>
[src]
&mut self,
id: InterruptedReachAttempt<TInEvent, TConnInfo, TUserData>
) -> StartTakeOver<(), 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.
pub fn complete_take_over(&mut self) -> Poll<(), ()>
[src]
Complete a take over initiated by start_take_over
.
Auto Trait Implementations
impl<'a, TInEvent, TUserData, TConnInfo, TPeerId> Unpin for PeerMut<'a, TInEvent, TUserData, TConnInfo, TPeerId> where
TConnInfo: Unpin,
TInEvent: Unpin,
TUserData: Unpin,
TConnInfo: Unpin,
TInEvent: Unpin,
TUserData: Unpin,
impl<'a, TInEvent, TUserData, TConnInfo, TPeerId> Sync for PeerMut<'a, TInEvent, TUserData, TConnInfo, TPeerId> where
TConnInfo: Sync,
TInEvent: Send + Sync,
TPeerId: Sync,
TUserData: Sync,
TConnInfo: Sync,
TInEvent: Send + Sync,
TPeerId: Sync,
TUserData: Sync,
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 = PeerId, TPeerId = PeerId> !RefUnwindSafe 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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self