pub struct BoxAnyVarValue(/* private fields */);Expand description
Small box for AnyVarValue values.
Implementations§
Source§impl BoxAnyVarValue
impl BoxAnyVarValue
Sourcepub fn new(value: impl AnyVarValue) -> Self
pub fn new(value: impl AnyVarValue) -> Self
Box 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: VarValue>(&self) -> Option<&T>
pub fn downcast_ref<T: VarValue>(&self) -> Option<&T>
Returns some reference to the inner value if it is of type T, or
None if it isn’t.
Sourcepub fn downcast_mut<T: VarValue>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: VarValue>(&mut self) -> Option<&mut T>
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§impl Debug for BoxAnyVarValue
impl Debug for BoxAnyVarValue
Source§impl Deref for BoxAnyVarValue
impl Deref 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,
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