pub struct ScopedKey<T>where
T: 'static,{ /* private fields */ }Expand description
Wrapper for scoped_tls::ScopedKey with better error messages.
Implementations§
Source§impl<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) -> R
pub fn with<F, R>(&'static self, f: F) -> 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> Freeze for ScopedKey<T>
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§
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes