[][src]Trait liquid::ValueView

pub trait ValueView: Debug {
    fn as_debug(&self) -> &dyn Debug;
fn render(&self) -> DisplayCow;
fn source(&self) -> DisplayCow;
fn type_name(&self) -> &'static str;
fn query_state(&self, state: State) -> bool;
fn to_kstr(&self) -> KStringCow;
fn to_value(&self) -> Value; fn as_scalar(&self) -> Option<ScalarCow> { ... }
fn is_scalar(&self) -> bool { ... }
fn as_array(&self) -> Option<&dyn ArrayView> { ... }
fn is_array(&self) -> bool { ... }
fn as_object(&self) -> Option<&dyn ObjectView> { ... }
fn is_object(&self) -> bool { ... }
fn as_state(&self) -> Option<State> { ... }
fn is_state(&self) -> bool { ... }
fn is_nil(&self) -> bool { ... } }

Accessor for Values.

Required methods

fn as_debug(&self) -> &dyn Debug

Get a Debug representation

fn render(&self) -> DisplayCow

A Display for a BoxedValue rendered for the user.

fn source(&self) -> DisplayCow

A Display for a Value as source code.

fn type_name(&self) -> &'static str

Report the data type (generally for error reporting).

fn query_state(&self, state: State) -> bool

Query the value's state

fn to_kstr(&self) -> KStringCow

Interpret as a string.

fn to_value(&self) -> Value

Convert to an owned type.

Loading content...

Provided methods

fn as_scalar(&self) -> Option<ScalarCow>

Extracts the scalar value if it is a scalar.

fn is_scalar(&self) -> bool

Tests whether this value is a scalar

fn as_array(&self) -> Option<&dyn ArrayView>

Extracts the array value if it is an array.

fn is_array(&self) -> bool

Tests whether this value is an array

fn as_object(&self) -> Option<&dyn ObjectView>

Extracts the object value if it is a object.

fn is_object(&self) -> bool

Tests whether this value is an object

fn as_state(&self) -> Option<State>

Extracts the state if it is one

fn is_state(&self) -> bool

Tests whether this value is state

fn is_nil(&self) -> bool

Tests whether this value is nil

See https://stackoverflow.com/questions/885414/a-concise-explanation-of-nil-v-empty-v-blank-in-ruby-on-rails

Loading content...

Implementations on Foreign Types

impl ValueView for i64[src]

impl ValueView for String[src]

impl ValueView for i16[src]

impl ValueView for i8[src]

impl ValueView for f32[src]

impl<K, V> ValueView for BTreeMap<K, V> where
    K: ObjectIndex,
    V: ValueView
[src]

impl ValueView for i32[src]

impl<'s> ValueView for &'s str[src]

impl<'s> ValueView for KStringCow<'s>[src]

impl<'s> ValueView for KStringRef<'s>[src]

impl ValueView for KString[src]

impl ValueView for u8[src]

impl ValueView for u16[src]

impl ValueView for bool[src]

impl ValueView for f64[src]

impl ValueView for u32[src]

impl<T> ValueView for Option<T> where
    T: ValueView
[src]

impl<T> ValueView for Vec<T> where
    T: ValueView
[src]

impl<K, V, S> ValueView for HashMap<K, V, S> where
    K: ObjectIndex,
    S: BuildHasher,
    V: ValueView
[src]

Loading content...

Implementors

impl ValueView for State[src]

impl ValueView for Value[src]

impl ValueView for Date[src]

impl ValueView for DateTime[src]

impl ValueView for Object[src]

impl<'s> ValueView for ValueCow<'s>[src]

impl<'s> ValueView for ScalarCow<'s>[src]

Loading content...