pub struct BoxAnyVarValue(/* private fields */);Expand description
Small box for AnyVarValue values.
Implementations§
Source§impl BoxAnyVarValue
impl BoxAnyVarValue
Sourcepub fn new(value: impl AnyVarValue) -> BoxAnyVarValue
pub fn new(value: impl AnyVarValue) -> BoxAnyVarValue
Box value.
Sourcepub fn downcast<T>(self) -> Result<T, BoxAnyVarValue>where
T: VarValue,
pub fn downcast<T>(self) -> Result<T, BoxAnyVarValue>where
T: VarValue,
Downcast to value.
Sourcepub fn type_id(&self) -> TypeId
pub fn type_id(&self) -> TypeId
Gets the TypeId of the boxed value.
Note that if you call Any::type_id directly on this type you will get the BoxAnyVarValue type id, not
the id of the actual value.
Sourcepub fn detailed_debug(&self) -> impl Debug
pub fn detailed_debug(&self) -> impl Debug
Alternate formatter that writes detailed debug info about the box and value type name.
The std::fmt::Debug implementation simply redirects to the value debug,
this wrapper provides more info.
Methods from Deref<Target = dyn AnyVarValue>§
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: VarValue,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: VarValue,
Returns some reference to the inner value if it is of type T, or
None if it isn’t.
Sourcepub fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: VarValue,
pub fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: VarValue,
Returns some mutable reference to the inner value if it is of type T, or
None if it isn’t.
Trait Implementations§
Source§impl Clone for BoxAnyVarValue
impl Clone for BoxAnyVarValue
Source§fn clone(&self) -> BoxAnyVarValue
fn clone(&self) -> BoxAnyVarValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BoxAnyVarValue
impl Debug for BoxAnyVarValue
Source§impl Deref for BoxAnyVarValue
impl Deref for BoxAnyVarValue
Source§type Target = dyn AnyVarValue
type Target = dyn AnyVarValue
The resulting type after dereferencing.
Source§impl DerefMut for BoxAnyVarValue
impl DerefMut for BoxAnyVarValue
Auto Trait Implementations§
impl !Freeze for BoxAnyVarValue
impl !RefUnwindSafe for BoxAnyVarValue
impl Send for BoxAnyVarValue
impl Sync for BoxAnyVarValue
impl !Unpin for BoxAnyVarValue
impl !UnwindSafe for BoxAnyVarValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more