[][src]Struct libp2p_core::nodes::collection::PeerMut

pub struct PeerMut<'a, TInEvent, TUserData, TConnInfo = PeerId, TPeerId = PeerId> { /* fields omitted */ }

Access to a peer in the collection.

Methods

impl<'a, TInEvent, TUserData, TConnInfo, TPeerId> PeerMut<'a, TInEvent, TUserData, TConnInfo, TPeerId>[src]

pub fn info(&self) -> &TConnInfo[src]

Returns the information of the connection with the peer.

impl<'a, TInEvent, TUserData, TConnInfo, TPeerId> PeerMut<'a, TInEvent, TUserData, TConnInfo, TPeerId> where
    TConnInfo: ConnectionInfo<PeerId = TPeerId>,
    TPeerId: Eq + Hash
[src]

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]

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

impl<'a, TInEvent, TUserData, TConnInfo, TPeerId> Sync for PeerMut<'a, TInEvent, TUserData, TConnInfo, TPeerId> where
    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

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]

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> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<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