Skip to main content

DecodeBody

Trait DecodeBody 

Source
pub trait DecodeBody<'de>
where Self: Decode<'de, Binary, Global> + Decode<'de, Text, Global>,
{ }
Available on crate feature api only.
Expand description

Types which can be decoded in every mode that this crate supports.

This is a blanket trait covering Decode in both the Binary and Text modes, which is what allows a message body to be decoded with any Format including Format::Json.

Deriving Decode implements every mode, so this is implemented automatically unless the type has been restricted to a specific mode.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'de, T> DecodeBody<'de> for T
where T: Decode<'de, Binary, Global> + Decode<'de, Text, Global>,