[−][src]Trait liquid_value::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