pub trait AsValue {
// Required methods
fn as_empty_value() -> Value;
fn as_value(self) -> Value;
fn try_from_value(value: Value) -> Result<Self>
where Self: Sized;
// Provided method
fn parse(input: impl AsRef<str>) -> Result<Self>
where Self: Sized { ... }
}Expand description
Convert both ways between Rust types and Value (plus simple parsing).
Required Methods§
Sourcefn as_empty_value() -> Value
fn as_empty_value() -> Value
Return a NULL equivalent variant for this type.
Sourcefn try_from_value(value: Value) -> Result<Self>where
Self: Sized,
fn try_from_value(value: Value) -> Result<Self>where
Self: Sized,
Try to convert a dynamic Value into Self.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.