Serde

Trait Serde 

Source
pub trait Serde {
    // Required methods
    fn serialize<T: Serialize>(obj: &T) -> StdResult<Vec<u8>>;
    fn deserialize<T: DeserializeOwned>(data: &[u8]) -> StdResult<T>;
}
Expand description

This trait represents the ability to both serialize and deserialize using a specific format.

This is useful for types that want to have a default mode of serialization, but want to allow users to override it if they want to.

It is intentionally simple at the moment to keep the implementation easy.

Required 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.

Implementors§