pub struct SessionId(/* private fields */);Expand description
Identifier for a browser session (Firefox window/process).
Generated by an atomic counter starting at 1. Each call to SessionId::next()
returns a unique, incrementing ID. Thread-safe and lock-free.
§Example
ⓘ
let session1 = SessionId::next();
let session2 = SessionId::next();
assert!(session1.as_u32() < session2.as_u32());Implementations§
Source§impl SessionId
impl SessionId
Sourcepub fn next() -> Self
pub fn next() -> Self
Generates the next unique session ID.
Uses an atomic counter that starts at 1 and increments. Thread-safe and lock-free.
§Panics
Panics if counter overflows (after 2^32 - 1 sessions).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SessionId
impl<'de> Deserialize<'de> for SessionId
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for SessionId
impl Ord for SessionId
Source§impl PartialOrd for SessionId
impl PartialOrd for SessionId
impl Copy for SessionId
impl Eq for SessionId
impl StructuralPartialEq for SessionId
Auto Trait Implementations§
impl Freeze for SessionId
impl RefUnwindSafe for SessionId
impl Send for SessionId
impl Sync for SessionId
impl Unpin for SessionId
impl UnwindSafe for SessionId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.