Skip to main content

StructEmitter

Trait StructEmitter 

Source
pub trait StructEmitter: Send {
    // Required method
    fn next(
        &mut self,
        state: &mut State,
    ) -> Result<Option<(Cow<'_, str>, SerializeHandle<'_>)>, Error>;
}
Expand description

A struct emitter.

A struct emitter is a simplified version of a MapEmitter which produces struct field and value in one go. The object model itself however does not know structs, it only knows about maps.

Required Methods§

Source

fn next( &mut self, state: &mut State, ) -> Result<Option<(Cow<'_, str>, SerializeHandle<'_>)>, Error>

Produces the next field and value in the struct.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§