[−][src]Enum liquid_value::Value
An enum to represent different value types
Variants
Scalar(Scalar)
A scalar value.
Array(Array)
A sequence of Value
s.
Object(Object)
A sequence of key/Value
pairs.
State(State)
Query symbol.
Nothing.
Methods
impl Value
[src]
pub fn scalar<T: Into<Scalar>>(value: T) -> Self
[src]
Create as a Scalar
.
pub fn array<I: IntoIterator<Item = Value>>(iter: I) -> Value
[src]
Create as an Array
.
pub fn as_view(&self) -> &dyn ValueView
[src]
Performs the conversion.
pub fn into_scalar(self) -> Option<Scalar>
[src]
Extracts the scalar value if it is a scalar.
pub fn into_array(self) -> Option<Array>
[src]
Extracts the array value if it is an array.
pub fn as_array_mut(&mut self) -> Option<&mut Array>
[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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Value
[src]
impl<'s> From<&'s Value> for ValueCow<'s>
[src]
impl From<Map> 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]
fn eq(&self, other: &KStringCow<'s>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'s> PartialEq<KStringRef<'s>> for Value
[src]
fn eq(&self, other: &KStringRef<'s>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'s> PartialEq<String> for Value
[src]
impl<'v> PartialEq<Value> for ValueCow<'v>
[src]
impl PartialEq<Value> for Value
[src]
impl<'v> PartialEq<ValueViewCmp<'v>> for Value
[src]
fn eq(&self, other: &ValueViewCmp<'v>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<bool> for Value
[src]
impl PartialEq<f64> for Value
[src]
impl PartialEq<i32> for Value
[src]
impl PartialEq<str> for Value
[src]
impl PartialOrd<Value> for Value
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for Value
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl ValueView for Value
[src]
fn as_debug(&self) -> &dyn Debug
[src]
fn render(&self) -> DisplayCow
[src]
fn source(&self) -> DisplayCow
[src]
fn type_name(&self) -> &'static str
[src]
fn query_state(&self, state: State) -> bool
[src]
fn to_kstr(&self) -> KStringCow
[src]
fn to_value(&self) -> Value
[src]
fn as_scalar(&self) -> Option<ScalarCow>
[src]
fn as_array(&self) -> Option<&dyn ArrayView>
[src]
fn as_object(&self) -> Option<&dyn ObjectView>
[src]
fn as_state(&self) -> Option<State>
[src]
fn is_nil(&self) -> bool
[src]
fn is_scalar(&self) -> bool
[src]
fn is_array(&self) -> bool
[src]
fn is_object(&self) -> bool
[src]
fn is_state(&self) -> bool
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,