Trait Encoder

Source
pub trait Encoder {
    // Required method
    fn encode(&mut self, idx: usize, out: &mut Vec<u8>);
}
Expand description

A trait to format array values as JSON values

Nullability is handled by the caller to allow encoding nulls implicitly, i.e. {} instead of {"a": null}

Required Methods§

Source

fn encode(&mut self, idx: usize, out: &mut Vec<u8>)

Encode the non-null value at index idx to out.

The behaviour is unspecified if idx corresponds to a null index.

Implementors§