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

Get a Debug representation

A Display for a BoxedValue rendered for the user.

A Display for a Value as source code.

Report the data type (generally for error reporting).

Query the value’s state

Interpret as a string.

Convert to an owned type.

Provided methods

Extracts the scalar value if it is a scalar.

Tests whether this value is a scalar

Extracts the array value if it is an array.

Tests whether this value is an array

Extracts the object value if it is a object.

Tests whether this value is an object

Extracts the state if it is one

Tests whether this value is state

Tests whether this value is nil

See the Stack overflow table

Implementations on Foreign Types

Implementors