Type Alias SocketId

Source
pub type SocketId<BC> = DeviceSocketId<WeakDeviceId<BC>, BC>;
Expand description

Public identifier for a socket.

Strongly owns the state of the socket. So long as the SocketId for a socket is not dropped, the socket is guaranteed to exist.

Aliased Type§

struct SocketId<BC>(/* private fields */);

Implementations

Source§

impl<D: Send + Sync + Debug, BT: DeviceSocketTypes> DeviceSocketId<D, BT>

Source

pub fn socket_state(&self) -> &BT::SocketState<D>

Provides immutable access to DeviceSocketTypes::SocketState for the socket.

Source

pub fn downgrade(&self) -> WeakDeviceSocketId<D, BT>

Obtain a WeakDeviceSocketId from this DeviceSocketId.

Source

pub fn counters(&self) -> &DeviceSocketCounters

Provides access to the socket’s counters.

Trait Implementations

Source§

impl<D: Send + Sync + Debug, BT: DeviceSocketTypes> Clone for DeviceSocketId<D, BT>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<D: Send + Sync + Debug, BT: DeviceSocketTypes> Debug for DeviceSocketId<D, BT>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<D: Send + Sync + Debug, BT: DeviceSocketTypes> Hash for DeviceSocketId<D, BT>

Source§

fn hash<__HDBT>(&self, __state: &mut __HDBT)
where __HDBT: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<D: Send + Sync + Debug, BT: DeviceSocketTypes> OrderedLockAccess<Target<D>> for DeviceSocketId<D, BT>

Source§

type Lock = Mutex<Target<D>>

The lock type that observes ordering. Read more
Source§

fn ordered_lock_access(&self) -> OrderedLockRef<'_, Self::Lock>

Returns a borrow to the order-aware lock. Read more
Source§

impl<D: Send + Sync + Debug, BT: DeviceSocketTypes> PartialEq for DeviceSocketId<D, BT>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<D: Send + Sync + Debug, BT: DeviceSocketTypes> Eq for DeviceSocketId<D, BT>