[go: up one dir, main page]

Format

Trait Format 

Source
pub trait Format: Debug { }
Expand description

A marker trait used to indicate the serialization format used for a response body.

The Response type uses this trait, in the F parameter, to determine how to deserialize the body in to the T model when using Response::into_body.

§How this trait works

This trait is a little funky, in order to allow the deserialization behavior of the format to be adjusted based on the type of the response body. This is just a marker trait, it has no methods. Instead, the method to actually perform the deserialization is defined in the DeserializeWith trait. This trait is parameterized by a type that implements the Format trait.

Implementors§