pub struct ConnectionId(/* private fields */);Expand description
The identity of one connection, unique and never reused within a process.
Workers take blocks of 1,024 ids from one process-wide counter, so ids are ordered within a worker, not globally.
§Examples
let id = net_io::ConnectionId::new(42).unwrap();
assert_eq!(id.get(), 42);
assert!(net_io::ConnectionId::new(0).is_none());Implementations§
Trait Implementations§
Source§impl Clone for ConnectionId
impl Clone for ConnectionId
impl Copy for ConnectionId
Source§impl Debug for ConnectionId
impl Debug for ConnectionId
Source§impl Display for ConnectionId
impl Display for ConnectionId
impl Eq for ConnectionId
Source§impl Hash for ConnectionId
impl Hash for ConnectionId
Source§impl Ord for ConnectionId
impl Ord for ConnectionId
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ConnectionId
impl PartialEq for ConnectionId
Source§impl PartialOrd for ConnectionId
impl PartialOrd for ConnectionId
impl StructuralPartialEq for ConnectionId
Auto Trait Implementations§
impl Freeze for ConnectionId
impl RefUnwindSafe for ConnectionId
impl Send for ConnectionId
impl Sync for ConnectionId
impl Unpin for ConnectionId
impl UnsafeUnpin 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