pub trait ValueView: Debug {
Show 16 methods
// Required 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) -> KStringCowBase<'_, Box<str, Global>>;
fn to_value(&self) -> Value;
// Provided methods
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§
sourcefn render(&self) -> DisplayCow<'_>
fn render(&self) -> DisplayCow<'_>
A Display
for a BoxedValue
rendered for the user.
sourcefn source(&self) -> DisplayCow<'_>
fn source(&self) -> DisplayCow<'_>
A Display
for a Value
as source code.
sourcefn query_state(&self, state: State) -> bool
fn query_state(&self, state: State) -> bool
Query the value’s state
Provided Methods§
sourcefn as_object(&self) -> Option<&dyn ObjectView>
fn as_object(&self) -> Option<&dyn ObjectView>
Extracts the object value if it is a object.
sourcefn is_nil(&self) -> bool
fn is_nil(&self) -> bool
Tests whether this value is nil
See the Stack overflow table