Struct Token
struct Token(306)
Associates readiness events with event::Sources.
Token is a wrapper around usize and is used as an argument to
Registry::register and Registry::reregister.
See Poll for more documentation on polling.
Example
Using Token to track which socket generated the event. In this example,
HashMap is used, but usually something like slab is better.
# use Error;
#
Implementations
impl Clone for Token
fn clone(self: &Self) -> Token
impl Copy for Token
impl Debug for Token
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Eq for Token
impl Freeze for Token
impl Hash for Token
fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)
impl Ord for Token
fn cmp(self: &Self, other: &Token) -> Ordering
impl PartialEq for Token
fn eq(self: &Self, other: &Token) -> bool
impl PartialOrd for Token
fn partial_cmp(self: &Self, other: &Token) -> Option<Ordering>
impl RefUnwindSafe for Token
impl Send for Token
impl StructuralPartialEq for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Token
impl<T> Any for Token
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Token
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Token
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Token
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for Token
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Token
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for Token
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Token
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Token
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>