[][src]Struct libp2p::core::nodes::collection::PeerMut

pub struct PeerMut<'a, TInEvent, TUserData, TConnInfo = PeerId, TPeerId = PeerId> where
    TConnInfo: 'a,
    TInEvent: 'a,
    TPeerId: 'a,
    TUserData: 'a, 
{ /* 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 send_event(&mut self, event: TInEvent)[src]

Sends an event to the given node.

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 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.

Auto Trait Implementations

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

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

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

impl<T> Erased for T

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.