#[repr(transparent)]pub struct ValueBox<T> { /* private fields */ }
Implementations
sourceimpl<T> ValueBox<T>
impl<T> ValueBox<T>
pub fn new(object: T) -> Self
pub fn null() -> Self
pub fn has_value(&self) -> bool
pub fn replace(&mut self, value: T) -> Option<T>
pub fn set_value(&mut self, object: T)
pub fn clone_value(&self) -> Option<T>where
T: Clone,
pub fn take_value(&mut self) -> Option<T>
pub fn into_raw(self) -> *mut Self
pub fn as_ref_mut(&mut self) -> Option<&mut T>
pub fn as_ptr(&self) -> *const T
pub fn as_ptr_mut(&mut self) -> *mut T
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for ValueBox<T>where
T: RefUnwindSafe,
impl<T> Send for ValueBox<T>where
T: Send,
impl<T> Sync for ValueBox<T>where
T: Sync,
impl<T> Unpin for ValueBox<T>where
T: Unpin,
impl<T> UnwindSafe for ValueBox<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more