pub struct ContextKey<T> { /* private fields */ }Expand description
A key for storing values in a Context.
Keys are identified by a name and the type they store.
§Examples
use do_over::context::ContextKey;
static USER_ID: ContextKey<u64> = ContextKey::new("user_id");
static TRACE_ID: ContextKey<String> = ContextKey::new("trace_id");Implementations§
Auto Trait Implementations§
impl<T> Freeze for ContextKey<T>
impl<T> RefUnwindSafe for ContextKey<T>where
T: RefUnwindSafe,
impl<T> Send for ContextKey<T>where
T: Send,
impl<T> Sync for ContextKey<T>where
T: Sync,
impl<T> Unpin for ContextKey<T>where
T: Unpin,
impl<T> UnwindSafe for ContextKey<T>where
T: UnwindSafe,
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