Param

Trait Param 

Source
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§

Source

fn to_string(&self) -> String

To json value

Source

fn from_string(s: String) -> Result<Self, Error>

From json value

Source

fn to_bytes(&self) -> Vec<u8>

To bytes

Source

fn from_bytes(bytes: Vec<u8>) -> Result<Self, Error>

From bytes

Source

fn to_value(&self) -> Value

To json value

Source

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.

Implementations on Foreign Types§

Source§

impl Param for String

Source§

impl Param for Vec<u8>

Implementors§