Trait liquid_core::model::ValueView
source · [−]pub trait ValueView: Debug {
Show 16 methods
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 { ... }
}
Expand description
Accessor for Values.
Required methods
fn render(&self) -> DisplayCow<'_>
fn render(&self) -> DisplayCow<'_>
A Display
for a BoxedValue
rendered for the user.
fn source(&self) -> DisplayCow<'_>
fn source(&self) -> DisplayCow<'_>
A Display
for a Value
as source code.
fn query_state(&self, state: State) -> bool
fn query_state(&self, state: State) -> bool
Query the value’s state
fn to_kstr(&self) -> KStringCow<'_>
fn to_kstr(&self) -> KStringCow<'_>
Interpret as a string.
Provided methods
fn as_object(&self) -> Option<&dyn ObjectView>
fn as_object(&self) -> Option<&dyn ObjectView>
Extracts the object value if it is a object.
Tests whether this value is nil
See the Stack overflow table