[−][src]Struct perthread::ThreadMap
This is a structure that lets you define a map with thread local variables, but also gives you access to all them behind a Mutex.
Implementations
impl<T> ThreadMap<T>
[src]
pub fn register(&'static self, val: T) -> PerThread<T> where
T: 'static + Sync,
[src]
T: 'static + Sync,
Register a new per-thread value with the thread map.
pub fn for_each<F>(&self, mut cb: F) where
F: FnMut(&T),
[src]
F: FnMut(&T),
Enumerate the per-thread values
This can't be an iterator because we need to control the lifetime of the returned reference, which is limited to the time we're holding the mutex (which is what's protecting the value from being destroyed while we're using it).
Trait Implementations
impl<T> Default for ThreadMap<T>
[src]
impl<T> Send for ThreadMap<T>
[src]
impl<T> Sync for ThreadMap<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for ThreadMap<T>
[src]
impl<T> Unpin for ThreadMap<T>
[src]
impl<T> UnwindSafe for ThreadMap<T>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,