pub trait ValueTryAsContainer {
type Array: Array;
type Object: Object;
// Required methods
fn try_as_array(&self) -> Result<&Self::Array, TryTypeError>;
fn try_as_object(&self) -> Result<&Self::Object, TryTypeError>;
}
Expand description
try_as_*
access to container value types
Required Associated Types§
Required Methods§
sourcefn try_as_array(&self) -> Result<&Self::Array, TryTypeError>
fn try_as_array(&self) -> Result<&Self::Array, TryTypeError>
Tries to represent the value as an array and returns a reference to it
§Errors
if the requested type doesn’t match the actual type
sourcefn try_as_object(&self) -> Result<&Self::Object, TryTypeError>
fn try_as_object(&self) -> Result<&Self::Object, TryTypeError>
Tries to represent the value as an object and returns a reference to it
§Errors
if the requested type doesn’t match the actual type