pub trait Decode<T> {
// Required method
fn decode(bytes: &[u8]) -> Result<T>;
// Provided method
fn decode_from_value(value: Value) -> Result<T> { ... }
}
Expand description
The trait decodes the type from the bytes.
Required Methods§
Provided Methods§
Sourcefn decode_from_value(value: Value) -> Result<T>
fn decode_from_value(value: Value) -> Result<T>
Decodes the type T
from the Value
.
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.