Trait EventToBytes
pub trait EventToBytes {
// Required methods
fn binary_size(&self) -> usize;
fn write<W>(&self, writer: W) -> Result<(), Error>
where W: Write;
}
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§
fn 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", so this trait is not object safe.