[−]Trait liquid::ValueView
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.
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
Implementations on Foreign Types
impl<'s> ValueView for &'s str
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>
impl<'s> ValueView for ValueCow<'s>
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 as_array(&self) -> Option<&dyn ArrayView>
fn as_object(&self) -> Option<&dyn ObjectView>
fn as_state(&self) -> Option<State>
fn is_nil(&self) -> bool
impl ValueView for Date
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>
impl<K, V, S> ValueView for HashMap<K, V, S> where
K: ObjectIndex,
S: BuildHasher,
V: ValueView,
K: ObjectIndex,
S: BuildHasher,
V: ValueView,
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_object(&self) -> Option<&dyn ObjectView>
impl ValueView for i32
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>
impl ValueView for Map
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_object(&self) -> Option<&dyn ObjectView>
impl ValueView for Value
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 as_array(&self) -> Option<&dyn ArrayView>
fn as_object(&self) -> Option<&dyn ObjectView>
fn as_state(&self) -> Option<State>
fn is_nil(&self) -> bool
impl ValueView for f64
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>
impl<T> ValueView for Option<T> where
T: ValueView,
T: ValueView,
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 as_array(&self) -> Option<&dyn ArrayView>
fn as_object(&self) -> Option<&dyn ObjectView>
fn as_state(&self) -> Option<State>
fn is_nil(&self) -> bool
impl<T> ValueView for Vec<T> where
T: ValueView,
T: ValueView,
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_array(&self) -> Option<&dyn ArrayView>
impl ValueView for State
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_state(&self) -> Option<State>
impl<'s> ValueView for KStringRef<'s>
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>
impl ValueView for KString
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>
impl ValueView for String
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>
impl ValueView for DateTime
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>
impl<'s> ValueView for KStringCow<'s>
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>
impl ValueView for bool
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>
impl<'s> ValueView for ScalarCow<'s>
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>
impl<K, V> ValueView for BTreeMap<K, V> where
K: ObjectIndex,
V: ValueView,
K: ObjectIndex,
V: ValueView,