Enum RefValue

Source
pub enum RefValue<'a> {
    Integer(Integer),
    Nil,
    Boolean(bool),
    Float(Float),
    Binary(&'a [u8]),
    String(Utf8StringRef<'a>),
    Array(Vec<RefValue<'a>>),
    Map(Vec<(RefValue<'a>, RefValue<'a>)>),
    Extension(i8, &'a [u8]),
    Timestamp(i64, u32),
}

Variants§

§

Integer(Integer)

§

Nil

§

Boolean(bool)

§

Float(Float)

§

Binary(&'a [u8])

§

String(Utf8StringRef<'a>)

§

Array(Vec<RefValue<'a>>)

§

Map(Vec<(RefValue<'a>, RefValue<'a>)>)

§

Extension(i8, &'a [u8])

§

Timestamp(i64, u32)

Implementations§

Source§

impl<'a> RefValue<'a>

Source

pub fn to_owned(&self) -> Value

Source

pub fn to_nil(&self) -> Option<Nil>

Source

pub fn to_ary(&self) -> Option<&Vec<RefValue<'_>>>

Source

pub fn to_str(&self) -> Option<&str>

Source

pub fn to_slice(&self) -> Option<&[u8]>

Trait Implementations§

Source§

impl<'a> Debug for RefValue<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> Display for RefValue<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a str> for RefValue<'a>

Source§

fn from(v: &'a str) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<bool> for RefValue<'a>

Source§

fn from(v: bool) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<f32> for RefValue<'a>

Source§

fn from(v: f32) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<f64> for RefValue<'a>

Source§

fn from(v: f64) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<i16> for RefValue<'a>

Source§

fn from(n: i16) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<i32> for RefValue<'a>

Source§

fn from(n: i32) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<i64> for RefValue<'a>

Source§

fn from(n: i64) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<i8> for RefValue<'a>

Source§

fn from(n: i8) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<isize> for RefValue<'a>

Source§

fn from(n: isize) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<u16> for RefValue<'a>

Source§

fn from(n: u16) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<u32> for RefValue<'a>

Source§

fn from(n: u32) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<u64> for RefValue<'a>

Source§

fn from(n: u64) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<u8> for RefValue<'a>

Source§

fn from(n: u8) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<usize> for RefValue<'a>

Source§

fn from(n: usize) -> Self

Converts to this type from the input type.
Source§

impl<'a> PartialEq for RefValue<'a>

Source§

fn eq(&self, other: &RefValue<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> StructuralPartialEq for RefValue<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for RefValue<'a>

§

impl<'a> RefUnwindSafe for RefValue<'a>

§

impl<'a> Send for RefValue<'a>

§

impl<'a> Sync for RefValue<'a>

§

impl<'a> Unpin for RefValue<'a>

§

impl<'a> UnwindSafe for RefValue<'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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.