[][src]Enum liquid::model::Value

pub enum Value {
    Scalar(ScalarCow<'static>),
    Array(Vec<Value>),
    Object(Object),
    State(State),
    Nil,
}

An enum to represent different value types

Variants

Scalar(ScalarCow<'static>)

A scalar value.

Array(Vec<Value>)

A sequence of Values.

Object(Object)

A sequence of key/Value pairs.

State(State)

Query symbol.

Nil

Nothing.

Implementations

impl Value[src]

pub fn scalar<T>(value: T) -> Value where
    T: Into<ScalarCow<'static>>, 
[src]

Create as a Scalar.

pub fn array<I>(iter: I) -> Value where
    I: IntoIterator<Item = Value>, 
[src]

Create as an Array.

pub fn as_view(&self) -> &dyn ValueView[src]

Performs the conversion.

pub fn into_scalar(self) -> Option<ScalarCow<'static>>[src]

Extracts the scalar value if it is a scalar.

pub fn into_array(self) -> Option<Vec<Value>>[src]

Extracts the array value if it is an array.

pub fn as_array_mut(&mut self) -> Option<&mut Vec<Value>>[src]

Extracts the array value as mutable if it is a object.

pub fn into_object(self) -> Option<Object>[src]

Extracts the object value if it is a object.

pub fn as_object_mut(&mut self) -> Option<&mut Object>[src]

Extracts the object value as mutable if it is a object.

pub fn into_state(self) -> Option<State>[src]

Extracts the state if it is one

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl Default for Value[src]

impl<'de> Deserialize<'de> for Value[src]

impl Eq for Value[src]

impl<'s> From<&'s Value> for ValueCow<'s>[src]

impl From<Object> for Value[src]

impl From<ScalarCow<'static>> for Value[src]

impl From<State> for Value[src]

impl From<Value> for ValueCow<'static>[src]

impl From<Vec<Value>> for Value[src]

impl<'s> PartialEq<&'s str> for Value[src]

impl PartialEq<Date> for Value[src]

impl PartialEq<DateTime> for Value[src]

impl PartialEq<KString> for Value[src]

impl<'s> PartialEq<KStringCow<'s>> for Value[src]

impl<'s> PartialEq<KStringRef<'s>> for Value[src]

impl<'s> PartialEq<String> for Value[src]

impl PartialEq<Value> for Value[src]

impl<'v> PartialEq<Value> for ValueCow<'v>[src]

impl<'v> PartialEq<ValueViewCmp<'v>> for Value[src]

impl PartialEq<bool> for Value[src]

impl PartialEq<f64> for Value[src]

impl PartialEq<i64> for Value[src]

impl PartialEq<str> for Value[src]

impl PartialOrd<Value> for Value[src]

impl Serialize for Value[src]

impl ValueView for Value[src]

Auto Trait Implementations

impl RefUnwindSafe for Value

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.