Struct libp2p::core::connection::ConnectionId
source · pub struct ConnectionId(_);
Expand description
Connection identifier.
Implementations§
source§impl ConnectionId
impl ConnectionId
sourcepub fn new(id: usize) -> ConnectionId
pub fn new(id: usize) -> ConnectionId
Creates a ConnectionId
from a non-negative integer.
This is primarily useful for creating connection IDs in test environments. There is in general no guarantee that all connection IDs are based on non-negative integers.
Trait Implementations§
source§impl Add<usize> for ConnectionId
impl Add<usize> for ConnectionId
§type Output = ConnectionId
type Output = ConnectionId
The resulting type after applying the
+
operator.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