pub struct ThreadLocalContext<C>(/* private fields */)
where
C: 'static;
Expand description
A wrapper for a context that uses thread-local storage.
Implementations§
Source§impl<C> ThreadLocalContext<C>where
C: 'static,
impl<C> ThreadLocalContext<C>where
C: 'static,
Sourcepub const fn new(local_key: &'static LocalKey<C>) -> ThreadLocalContext<C>
pub const fn new(local_key: &'static LocalKey<C>) -> ThreadLocalContext<C>
Wrap a thread-local container with a context.
Trait Implementations§
Source§impl<C> ClockSequence for ThreadLocalContext<C>where
C: ClockSequence + 'static,
impl<C> ClockSequence for ThreadLocalContext<C>where
C: ClockSequence + 'static,
Source§type Output = <C as ClockSequence>::Output
type Output = <C as ClockSequence>::Output
The type of sequence returned by this counter.
Source§fn generate_sequence(
&self,
seconds: u64,
subsec_nanos: u32,
) -> <ThreadLocalContext<C> as ClockSequence>::Output
fn generate_sequence( &self, seconds: u64, subsec_nanos: u32, ) -> <ThreadLocalContext<C> as ClockSequence>::Output
Get the next value in the sequence to feed into a timestamp. Read more
Source§fn generate_timestamp_sequence(
&self,
seconds: u64,
subsec_nanos: u32,
) -> (<ThreadLocalContext<C> as ClockSequence>::Output, u64, u32)
fn generate_timestamp_sequence( &self, seconds: u64, subsec_nanos: u32, ) -> (<ThreadLocalContext<C> as ClockSequence>::Output, u64, u32)
Get the next value in the sequence, potentially also adjusting the timestamp. Read more
Source§fn usable_bits(&self) -> usize
fn usable_bits(&self) -> usize
The number of usable bits from the least significant bit in the result of
ClockSequence::generate_sequence
or ClockSequence::generate_timestamp_sequence
. Read moreAuto Trait Implementations§
impl<C> Freeze for ThreadLocalContext<C>
impl<C> RefUnwindSafe for ThreadLocalContext<C>
impl<C> Send for ThreadLocalContext<C>
impl<C> Sync for ThreadLocalContext<C>
impl<C> Unpin for ThreadLocalContext<C>
impl<C> UnwindSafe for ThreadLocalContext<C>
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