Trait EventDataWrite
pub trait EventDataWrite {
// Required method
fn write_data(
&self,
w: &mut impl Write,
) -> Result<(), Box<dyn Error + Send + Sync>>;
// Provided method
fn size_hint(&self) -> Option<usize> { ... }
}Available on crate features
http and std only.Expand description
Trait that can be implemented for a custom data type that is to be written (by a server).
Required Methods§
Provided Methods§
fn size_hint(&self) -> Option<usize>
fn size_hint(&self) -> Option<usize>
Best-effort size in bytes of the data write_data will produce
(excluding any data: line prefixes inserted around it), used to
pre-reserve serialization buffers. None when unknown up front.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".