Trait value_trait::ValueInto
source · pub trait ValueInto: Sized + ValueAccess {
type String;
fn into_string(self) -> Option<Self::String>;
fn into_array(self) -> Option<Self::Array>;
fn into_object(self) -> Option<Self::Object>;
fn try_into_string(self) -> Result<Self::String, TryTypeError> { ... }
fn try_into_array(self) -> Result<Self::Array, TryTypeError> { ... }
fn try_into_object(self) -> Result<Self::Object, TryTypeError> { ... }
}
Expand description
A trait that specifies how to turn the Value into
it’s sub types
Required Associated Types
Required Methods
sourcefn into_string(self) -> Option<Self::String>
fn into_string(self) -> Option<Self::String>
Tries to turn the value into it’s string representation
sourcefn into_array(self) -> Option<Self::Array>
fn into_array(self) -> Option<Self::Array>
Tries to turn the value into it’s array representation
sourcefn into_object(self) -> Option<Self::Object>
fn into_object(self) -> Option<Self::Object>
Tries to turn the value into it’s object representation
Provided Methods
sourcefn try_into_string(self) -> Result<Self::String, TryTypeError>
fn try_into_string(self) -> Result<Self::String, TryTypeError>
Tries to turn the value into it’s string representation
Errors
if the requested type doesn’t match the actual type
sourcefn try_into_array(self) -> Result<Self::Array, TryTypeError>
fn try_into_array(self) -> Result<Self::Array, TryTypeError>
Tries to turn the value into it’s array representation
Errors
if the requested type doesn’t match the actual type
sourcefn try_into_object(self) -> Result<Self::Object, TryTypeError>
fn try_into_object(self) -> Result<Self::Object, TryTypeError>
Tries to turn the value into it’s object representation
Errors
if the requested type doesn’t match the actual type