pub trait SerdeFormat {
// Required methods
fn to_vec<S: Serialize>(s: &S) -> Result<Vec<u8>, ()>;
fn from_slice<D: DeserializeOwned>(data: &[u8]) -> Result<D, ()>;
}
Expand description
A serde de/serialization format that will be used for a service.
Required Methods§
fn to_vec<S: Serialize>(s: &S) -> Result<Vec<u8>, ()>
fn from_slice<D: DeserializeOwned>(data: &[u8]) -> Result<D, ()>
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.