pub struct Token(/* private fields */);Expand description
Opaque handle identifying a notification source.
Created by the user from their own key space (slab keys, array
indices). The event queue never assigns tokens — it treats the
index as an offset into its internal per-token state. Passing a
token whose index exceeds the queue’s capacity will panic on use
(e.g., in Notifier::notify).
§Examples
use nexus_notify::Token;
let token = Token::new(42);
assert_eq!(token.index(), 42);
let from_usize = Token::from(7usize);
assert_eq!(from_usize.index(), 7);Implementations§
Trait Implementations§
impl Copy for Token
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Token
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