pub trait EventToBytes {
// Required methods
fn binary_size(&self) -> usize;
fn write<W: Write>(&self, writer: W) -> Result<()>;
}Expand description
Trait for converting events to a byte representation.
This trait is implemented for types that can be serialized into a byte array representing
an event. It has the same methods as crate::events::payload::PayloadToBytes, but is a separate
trait to disallow serializing raw payloads that are not events by mistake.
Required Methods§
Sourcefn binary_size(&self) -> usize
fn binary_size(&self) -> usize
Get the binary size of the event.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".