Struct rustc_data_structures::sync::OneThread [−][src]
pub struct OneThread<T> { /* fields omitted */ }
A type which only allows its inner value to be used in one thread. It will panic if it is used on multiple threads.
Methods
impl<T> OneThread<T>
[src]
impl<T> OneThread<T>
pub fn new(inner: T) -> Self
[src]
pub fn new(inner: T) -> Self
pub fn into_inner(value: Self) -> T
[src]
pub fn into_inner(value: Self) -> T
Trait Implementations
impl<T: Copy> Copy for OneThread<T>
[src]
impl<T: Copy> Copy for OneThread<T>
impl<T: Clone> Clone for OneThread<T>
[src]
impl<T: Clone> Clone for OneThread<T>
fn clone(&self) -> OneThread<T>
[src]
fn clone(&self) -> OneThread<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<T: Hash> Hash for OneThread<T>
[src]
impl<T: Hash> Hash for OneThread<T>
fn hash<__HT: Hasher>(&self, state: &mut __HT)
[src]
fn hash<__HT: Hasher>(&self, state: &mut __HT)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
[src]Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: Debug> Debug for OneThread<T>
[src]
impl<T: Debug> Debug for OneThread<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Eq> Eq for OneThread<T>
[src]
impl<T: Eq> Eq for OneThread<T>
impl<T: PartialEq> PartialEq for OneThread<T>
[src]
impl<T: PartialEq> PartialEq for OneThread<T>
fn eq(&self, other: &OneThread<T>) -> bool
[src]
fn eq(&self, other: &OneThread<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &OneThread<T>) -> bool
[src]
fn ne(&self, other: &OneThread<T>) -> bool
This method tests for !=
.
impl<T> Deref for OneThread<T>
[src]
impl<T> Deref for OneThread<T>
type Target = T
The resulting type after dereferencing.
ⓘImportant traits for &'a mut Rfn deref(&self) -> &T
[src]
ⓘImportant traits for &'a mut R
fn deref(&self) -> &T
Dereferences the value.
impl<T> DerefMut for OneThread<T>
[src]
impl<T> DerefMut for OneThread<T>