Struct libp2p_swarm::ConnectionId
source · pub struct ConnectionId(_);
Expand description
Connection identifier.
Implementations§
source§impl ConnectionId
impl ConnectionId
sourcepub const DUMMY: ConnectionId = _
👎Deprecated since 0.42.0: Don’t use this, it will be removed at a later stage again.
pub const DUMMY: ConnectionId = _
A “dummy” ConnectionId
.
Really, you should not use this, not even for testing but it is here if you need it.
sourcepub fn new_unchecked(id: usize) -> Self
pub fn new_unchecked(id: usize) -> Self
Creates an unchecked ConnectionId
.
Swarm
enforces that ConnectionId
s are unique and not reused.
This constructor does not, hence the unchecked.
It is primarily meant for allowing manual tests of NetworkBehaviour
s.
Trait Implementations§
source§impl Clone for ConnectionId
impl Clone for ConnectionId
source§fn clone(&self) -> ConnectionId
fn clone(&self) -> ConnectionId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ConnectionId
impl Debug for ConnectionId
source§impl Hash for ConnectionId
impl Hash for ConnectionId
source§impl Ord for ConnectionId
impl Ord for ConnectionId
source§fn cmp(&self, other: &ConnectionId) -> Ordering
fn cmp(&self, other: &ConnectionId) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<ConnectionId> for ConnectionId
impl PartialEq<ConnectionId> for ConnectionId
source§fn eq(&self, other: &ConnectionId) -> bool
fn eq(&self, other: &ConnectionId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ConnectionId> for ConnectionId
impl PartialOrd<ConnectionId> for ConnectionId
source§fn partial_cmp(&self, other: &ConnectionId) -> Option<Ordering>
fn partial_cmp(&self, other: &ConnectionId) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for ConnectionId
impl Eq for ConnectionId
impl StructuralEq for ConnectionId
impl StructuralPartialEq for ConnectionId
Auto Trait Implementations§
impl RefUnwindSafe for ConnectionId
impl Send for ConnectionId
impl Sync for ConnectionId
impl Unpin for ConnectionId
impl UnwindSafe for ConnectionId
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more