Skip to main content

TokenSink

Trait TokenSink 

pub trait TokenSink {
    // Required method
    fn token(&mut self, token: Token<'_>) -> Result<(), JsonError>;
}
Expand description

Consumes JSON tokens emitted by Tokenizer.

Required Methods§

fn token(&mut self, token: Token<'_>) -> Result<(), JsonError>

Handles one token.

Returning an error aborts tokenization and surfaces the error from Tokenizer::write or Tokenizer::end.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§