[−][src]Struct parity_send_wrapper::SendWrapper
A wrapper which allows you to move around non-Send
-types between threads, as long as you access the contained
value only from within the original thread and make sure that it is dropped from within the original thread.
Methods
impl<T> SendWrapper<T>
[src]
pub fn new(data: T) -> SendWrapper<T>
[src]
Create a SendWrapper
pub fn valid(&self) -> bool
[src]
Returns if the value can be safely accessed from within the current thread.
pub fn take(self) -> T
[src]
Takes the value out of the SendWrapper.
#Panics
Panics if it is called from a different thread than the one the SendWrapper
Trait Implementations
impl<T> Sync for SendWrapper<T>
[src]
impl<T> Send for SendWrapper<T>
[src]
impl<T> Drop for SendWrapper<T>
[src]
fn drop(&mut self)
[src]
Drops the contained value.
Panics
Dropping panics if it is done from a different thread than the one the SendWrapper
impl<T> DerefMut for SendWrapper<T>
[src]
fn deref_mut(&mut self) -> &mut T
[src]
Returns a mutable reference to the contained value.
Panics
Derefencing panics if it is done from a different thread than the one the SendWrapper
impl<T> Deref for SendWrapper<T>
[src]
Blanket Implementations
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,