ValueRef

Enum ValueRef 

Source
pub enum ValueRef<'a> {
    Float(&'a f64),
    Int(&'a i64),
    Bool(&'a bool),
    String(&'a Str),
    Map(&'a Map),
    Array(&'a Array),
    None,
}
Expand description

A borrowed reference to a Value.

This enum provides read‑only access to the data stored inside a Value without taking ownership. It mirrors the variants of Value but holds references (&'a …) to the underlying data, allowing inspection while preserving the original lifetime.

§Variants

  • Float(&'a f64) – Reference to a 64‑bit floating‑point number.
  • Int(&'a i64) – Reference to a signed 64‑bit integer.
  • Bool(&'a bool) – Reference to a boolean value.
  • String(&'a Str) – Reference to a string (Str) value.
  • Map(&'a Map) – Reference to a map container.
  • Array(&'a Array) – Reference to an array container.
  • None – Represents the absence of a value.

Variants§

§

Float(&'a f64)

Reference to a floating‑point number.

§

Int(&'a i64)

Reference to an integer.

§

Bool(&'a bool)

Reference to a boolean.

§

String(&'a Str)

Reference to a string.

§

Map(&'a Map)

Reference to a map.

§

Array(&'a Array)

Reference to an array.

§

None

No value.

Trait Implementations§

Source§

impl<'a> Debug for ValueRef<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ValueRef<'a>

§

impl<'a> RefUnwindSafe for ValueRef<'a>

§

impl<'a> Send for ValueRef<'a>

§

impl<'a> Sync for ValueRef<'a>

§

impl<'a> Unpin for ValueRef<'a>

§

impl<'a> UnwindSafe for ValueRef<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.