pub trait Param:
Sized
+ Send
+ Default {
// Required methods
fn to_string(&self) -> String;
fn from_string(s: String) -> Result<Self, Error>;
fn to_bytes(&self) -> Vec<u8> ⓘ;
fn from_bytes(bytes: Vec<u8>) -> Result<Self, Error>;
fn to_value(&self) -> Value;
fn from_value(v: Value) -> Result<Self, Error>;
}
Expand description
Export useful types Serialize & deserialize for params
Required Methods§
Sourcefn from_string(s: String) -> Result<Self, Error>
fn from_string(s: String) -> Result<Self, Error>
From json value
Sourcefn from_value(v: Value) -> Result<Self, Error>
fn from_value(v: Value) -> Result<Self, Error>
From json 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.