Skip to main content

EventDataWrite

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§

fn write_data( &self, w: &mut impl Write, ) -> Result<(), Box<dyn Error + Send + Sync>>

Provided Methods§

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".

Implementations on Foreign Types§

§

impl EventDataWrite for &str

§

fn write_data( &self, w: &mut impl Write, ) -> Result<(), Box<dyn Error + Send + Sync>>

§

fn size_hint(&self) -> Option<usize>

§

impl<T> EventDataWrite for [T]
where T: EventDataWrite,

§

fn write_data( &self, w: &mut impl Write, ) -> Result<(), Box<dyn Error + Send + Sync>>

§

fn size_hint(&self) -> Option<usize>

§

impl<const N: usize, T> EventDataWrite for [T; N]
where T: EventDataWrite,

§

fn write_data( &self, w: &mut impl Write, ) -> Result<(), Box<dyn Error + Send + Sync>>

§

fn size_hint(&self) -> Option<usize>

Implementors§

§

impl EventDataWrite for ArcStr

§

impl EventDataWrite for ExecuteScript

§

impl EventDataWrite for PatchElements

§

impl EventDataWrite for String

§

impl<A, B, C, D, E, F, G, H, I> EventDataWrite for Either9<A, B, C, D, E, F, G, H, I>

§

impl<A, B, C, D, E, F, G, H> EventDataWrite for Either8<A, B, C, D, E, F, G, H>

§

impl<A, B, C, D, E, F, G> EventDataWrite for Either7<A, B, C, D, E, F, G>

§

impl<A, B, C, D, E, F> EventDataWrite for Either6<A, B, C, D, E, F>

§

impl<A, B, C, D, E> EventDataWrite for Either5<A, B, C, D, E>

§

impl<A, B, C, D> EventDataWrite for Either4<A, B, C, D>

§

impl<A, B, C> EventDataWrite for Either3<A, B, C>

§

impl<A, B> EventDataWrite for Either<A, B>

§

impl<T> EventDataWrite for EventData<T>
where T: EventDataWrite,

§

impl<T> EventDataWrite for JsonEventData<T>
where T: Serialize,

§

impl<T> EventDataWrite for PatchSignals<T>
where T: EventDataWrite,

§

impl<T> EventDataWrite for Vec<T>
where T: EventDataWrite,