Skip to main content

EncodeBody

Trait EncodeBody 

Source
pub trait EncodeBody
where Self: Encode<Binary> + Encode<Text>,
{ }
Available on crate feature api only.
Expand description

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

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

Deriving Encode 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<T> EncodeBody for T
where T: ?Sized + Encode<Binary> + Encode<Text>,