[][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)[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]

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

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

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

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

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

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

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]

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<V, T> VZip<V> for T where
    V: MultiLane<T>,