pub trait Format: Debug {
// Required method
fn deserialize<T, S>(body: S) -> Result<T, Error>
where T: DeserializeOwned,
S: AsRef<[u8]>;
}Expand description
A trait used to indicate the serialization format used for a response body.
The Response type uses this trait in parameter F to determine how to deserialize the body in to the model T when using Response::into_body.
This allows the client library to define the format for each client method so callers can deserialize the model T without having to know or specify the format.
Required Methods§
Sourcefn deserialize<T, S>(body: S) -> Result<T, Error>
fn deserialize<T, S>(body: S) -> Result<T, Error>
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.