Skip to main content

JsonTransform

Trait JsonTransform 

pub trait JsonTransform {
    type Error;

    // Required method
    fn token(
        &mut self,
        token: Token<'_>,
        origin: TokenOrigin<'_>,
        out: &mut JsonOutput,
    ) -> Result<(), Self::Error>;
}
Available on crate feature std only.
Expand description

Transforms a JSON token stream into output bytes.

Required Associated Types§

type Error

Error a transform returns to stop the stream.

Required Methods§

fn token( &mut self, token: Token<'_>, origin: TokenOrigin<'_>, out: &mut JsonOutput, ) -> Result<(), Self::Error>

Handles one token, writing whatever it keeps or produces to out.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§