#[non_exhaustive]pub enum ValueView<'a> {
}Expand description
A borrowed view of a value.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
None
The absence of a value.
BorrowedStr(&'a str)
A borrowed string value.
StaticStr(&'static str)
A static string value.
Bytes(&'a [u8])
A byte array value.
Bool(bool)
A boolean value.
I64(i64)
A signed 64-bit integer value.
U64(u64)
An unsigned 64-bit integer value.
F64(f64)
A 64-bit floating point value.
I128(i128)
A signed 128-bit integer value.
U128(u128)
An unsigned 128-bit integer value.
Char(char)
A Unicode scalar value.
List(ListValue<'a>)
A list value.
Map(MapValue<'a>)
A map value.
Debug(DebugValue<'a>)
A lazily debug-formatted value.
Display(DisplayValue<'a>)
A lazily display-formatted value.
Implementations§
Source§impl ValueView<'_>
impl ValueView<'_>
Sourcepub fn to_owned(&self) -> ValueOwned
pub fn to_owned(&self) -> ValueOwned
Convert this view into an owned value.
Source§impl<'a> ValueView<'a>
impl<'a> ValueView<'a>
Sourcepub fn to_f64(&self) -> Option<f64>
pub fn to_f64(&self) -> Option<f64>
Try to convert this view into a 64-bit floating point number.
Sourcepub fn to_u128(&self) -> Option<u128>
pub fn to_u128(&self) -> Option<u128>
Try to convert this view into an unsigned 128-bit integer.
Sourcepub fn to_static_str(&self) -> Option<&'static str>
pub fn to_static_str(&self) -> Option<&'static str>
Try to convert this view into a static string slice.
Sourcepub fn to_display(&self) -> Option<DisplayValue<'a>>
pub fn to_display(&self) -> Option<DisplayValue<'a>>
Try to convert this view into a display-formatted value.
Sourcepub fn to_debug(&self) -> Option<DebugValue<'a>>
pub fn to_debug(&self) -> Option<DebugValue<'a>>
Try to convert this view into a debug-formatted value.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ValueView<'a>
impl<'a> !RefUnwindSafe for ValueView<'a>
impl<'a> !Send for ValueView<'a>
impl<'a> !Sync for ValueView<'a>
impl<'a> Unpin for ValueView<'a>
impl<'a> UnsafeUnpin for ValueView<'a>
impl<'a> !UnwindSafe for ValueView<'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