Struct thex::Thex
[−]
[src]
pub struct Thex<T> { /* fields omitted */ }
A wrapper type providing run-time shared ord thread-local exclusive access
to an inner value of type T
,
where T
implements StableDeref
Methods
impl<T: StableDeref> Thex<T>
[src]
fn new(t: T) -> Self
[src]
Construct a new wrapped value
[src]
Aquire a read-only shared reference to the contained T
unsafe fn exclusive(&self) -> Exclusive<T>
[src]
Returns a thread-exclusive lock to the wrapped value
Unsafety
It is unsafe to use this function, since you could easily alias the same value multiple times from the same thread.
If you want a safe alternative, you can use shared
and wrap
the value in a RefCell
Trait Implementations
impl<T: StableDeref + Debug> Debug for Thex<T>
[src]
impl<T: Clone + Debug + StableDeref> Clone for Thex<T>
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more