pub enum Intermediate {
    None,
    Bool(bool),
    Number(Number),
    String(Cow<'static, str>),
    Array(Vec<Intermediate>),
    Map(Map),
}
Expand description

Intermediate data representation.

The format is similar to JSON. It can be serialized/deserialized using serde.

Variants§

§

None

§

Bool(bool)

§

Number(Number)

§

String(Cow<'static, str>)

§

Array(Vec<Intermediate>)

§

Map(Map)

Implementations§

source§

impl Intermediate

source

pub fn is_none(&self) -> bool

Check if the value is None.

source

pub fn as_bool(&self) -> Option<bool>

Get the value as a boolean (if possible).

source

pub fn as_number(&self) -> Option<Number>

Get the numeric value (if possible).

source

pub fn as_char(&self) -> Option<char>

Get the value as a character (if possible).

source

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

Get the value as a string (if possible).

source

pub fn as_array(&self) -> Option<&[Intermediate]>

Get the value as an array (if possible).

source

pub fn as_map(&self) -> Option<&Map>

Get the value as a map (if possible).

Trait Implementations§

source§

impl Clone for Intermediate

source§

fn clone(&self) -> Intermediate

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Intermediate

source§

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

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

impl<'de> Deserialize<'de> for Intermediate

source§

fn deserialize<D>(deserializer: D) -> Result<Intermediate, D::Error>where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Deserialize for Intermediate

source§

fn deserialize(input: &Intermediate) -> Result<Self, Error>

Deserialize an object instance.
source§

impl From<&str> for Intermediate

source§

fn from(v: &str) -> Self

Converts to this type from the input type.
source§

impl From<()> for Intermediate

source§

fn from(_: ()) -> Self

Converts to this type from the input type.
source§

impl<K, V> From<HashMap<K, V>> for Intermediatewhere K: Into<Cow<'static, str>>, V: Into<Intermediate>,

source§

fn from(map: HashMap<K, V>) -> Self

Converts to this type from the input type.
source§

impl From<Number> for Intermediate

source§

fn from(v: Number) -> Self

Converts to this type from the input type.
source§

impl From<String> for Intermediate

source§

fn from(v: String) -> Self

Converts to this type from the input type.
source§

impl<T> From<Vec<T>> for Intermediatewhere Intermediate: From<T>,

source§

fn from(v: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Intermediate

source§

fn from(v: bool) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Intermediate

source§

fn from(v: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Intermediate

source§

fn from(v: f64) -> Self

Converts to this type from the input type.
source§

impl From<i16> for Intermediate

source§

fn from(v: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Intermediate

source§

fn from(v: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Intermediate

source§

fn from(v: i64) -> Self

Converts to this type from the input type.
source§

impl From<i8> for Intermediate

source§

fn from(v: i8) -> Self

Converts to this type from the input type.
source§

impl From<u16> for Intermediate

source§

fn from(v: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Intermediate

source§

fn from(v: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Intermediate

source§

fn from(v: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for Intermediate

source§

fn from(v: u8) -> Self

Converts to this type from the input type.
source§

impl Serialize for Intermediate

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Serialize for Intermediate

source§

fn serialize(&self) -> Result<Intermediate, Error>

Serialize the object.
source§

impl Update for Intermediate

source§

fn update(&mut self, other: &Intermediate) -> Result<(), Error>

Update the object.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,