pub struct NakedValue<'a>(pub &'a Value);Expand description
A value reference that formats without type tags
Tuple Fields§
§0: &'a ValueMethods from Deref<Target = Value>§
pub fn to_string_naked(&self) -> String
pub fn fmt_naked(&self, f: &mut Formatter<'_>) -> Result
pub fn fmt_notyp(&self, f: &mut Formatter<'_>) -> Result
pub fn fmt_ext( &self, f: &mut Formatter<'_>, esc: &Escape, types: bool, ) -> Result
pub fn approx_eq(&self, v: &Self) -> bool
Sourcepub fn discriminant(&self) -> u64
pub fn discriminant(&self) -> u64
return the discriminant tag of this value
Sourcepub fn is_copy(&self) -> bool
pub fn is_copy(&self) -> bool
return true if this value will be cloned by a direct bitwise copy
Sourcepub fn downcast_ref<T: Any + Send + Sync>(&self) -> Option<&T>
pub fn downcast_ref<T: Any + Send + Sync>(&self) -> Option<&T>
downcast an abstract value to it’s concrete type
return None if the value isn’t abstract, or if T is not it’s
concrete type.
Sourcepub unsafe fn get_as_unchecked<T>(&self) -> &T
pub unsafe fn get_as_unchecked<T>(&self) -> &T
get a reference to the payload of the value without checking the tag
If you are wrong about what kind of value you have then this could cause undefined behavior.
Trait Implementations§
Source§impl<'a> Deref for NakedValue<'a>
impl<'a> Deref for NakedValue<'a>
Auto Trait Implementations§
impl<'a> Freeze for NakedValue<'a>
impl<'a> !RefUnwindSafe for NakedValue<'a>
impl<'a> Send for NakedValue<'a>
impl<'a> Sync for NakedValue<'a>
impl<'a> Unpin for NakedValue<'a>
impl<'a> !UnwindSafe for NakedValue<'a>
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> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more