pub struct Value<T> { /* private fields */ }
Expand description
Value type
Implementations§
source§impl Value<RawType>
impl Value<RawType>
sourcepub fn try_downcast<O: Type>(self) -> Result<Box<O>, Self>
pub fn try_downcast<O: Type>(self) -> Result<Box<O>, Self>
Attempts downcast self into specified type
sourcepub fn try_downcast_ref<O: Type>(&self) -> Option<&O>
pub fn try_downcast_ref<O: Type>(&self) -> Option<&O>
Attempts to downcast self into concrete type
sourcepub fn try_downcast_mut<O: Type>(&mut self) -> Option<&mut O>
pub fn try_downcast_mut<O: Type>(&mut self) -> Option<&mut O>
Attempts to downcast self into concrete type
source§impl<T: Type> Value<T>
impl<T: Type> Value<T>
sourcepub unsafe fn new(inner: ValueBox) -> Self
pub unsafe fn new(inner: ValueBox) -> Self
Creates new raw Value trusting user to specify correct type
sourcepub fn from_boxed(inner: Box<T>) -> Self
pub fn from_boxed(inner: Box<T>) -> Self
Creates instance from concrete type
sourcepub fn downcast_ref(&self) -> &T
pub fn downcast_ref(&self) -> &T
Downcasts self into concrete type
sourcepub fn downcast_mut(&mut self) -> &mut T
pub fn downcast_mut(&mut self) -> &mut T
Downcasts self into concrete type
sourcepub fn as_raw_mut(&mut self) -> &mut ValueBox
pub fn as_raw_mut(&mut self) -> &mut ValueBox
Access underlying untyped pointer
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Value<T>
impl<T> Send for Value<T>where
T: Send,
impl<T> Sync for Value<T>where
T: Sync,
impl<T> Unpin for Value<T>where
T: Unpin,
impl<T> !UnwindSafe for Value<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more