Skip to main content

Body

Trait Body 

Source
pub trait Body:
    Serialize
    + DeserializeOwned
    + Clone
    + 'static { }
Expand description

The bound set every payload type must satisfy, aliased under one name so the engine’s generic signatures stay legible (B: Body rather than the four-trait mouthful everywhere).

It is blanket-implemented: any type that is serde-serializable, owned-deserializable, cloneable, and 'static is a Body automatically, so implementers never write impl Body by hand. DeserializeOwned (rather than Deserialize<'de>) is what lets the log hand back a payload that owns its data, decoupled from the lifetime of the record bytes it was decoded from.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T: Serialize + DeserializeOwned + Clone + 'static> Body for T