Struct better_scoped_tls::ScopedKey
source · [−]pub struct ScopedKey<T>where
T: 'static,{ /* private fields */ }
Expand description
Wrapper for scoped_tls::ScopedKey with better error messages.
Implementations
sourceimpl<T> ScopedKey<T>where
T: 'static,
impl<T> ScopedKey<T>where
T: 'static,
sourcepub fn set<F, R>(&'static self, t: &T, f: F) -> Rwhere
F: FnOnce() -> R,
pub fn set<F, R>(&'static self, t: &T, f: F) -> Rwhere
F: FnOnce() -> R,
See scoped_tls::ScopedKey for actual documentation.
sourcepub fn with<F, R>(&'static self, f: F) -> Rwhere
F: FnOnce(&T) -> R,
pub fn with<F, R>(&'static self, f: F) -> Rwhere
F: FnOnce(&T) -> R,
See scoped_tls::ScopedKey for actual documentation.
sourcepub fn is_set(&'static self) -> bool
pub fn is_set(&'static self) -> bool
See scoped_tls::ScopedKey for actual documentation.
Auto Trait Implementations
impl<T> RefUnwindSafe for ScopedKey<T>where
T: RefUnwindSafe,
impl<T> Send for ScopedKey<T>
impl<T> Sync for ScopedKey<T>
impl<T> Unpin for ScopedKey<T>
impl<T> UnwindSafe for ScopedKey<T>where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more