pub trait Sinker: MiniWrite {
    fn observe_new_item(
        &mut self,
        path: &[Vec<u8>],
        header_style: HeaderStyle
    ) -> Result<()> { ... } fn observe_end(&mut self, header_style: HeaderStyle) -> Result<()> { ... } }
Expand description

Consume the individual JSON documents.

For each document the following will be called, in this order:

  • observe_new_item, with the path if it was computed
  • write_all will be called repeatedly with the contents of the item
  • observe_end, when the item is finished

The default implementation is to produce a stream of ndjson on an existing Write impl.

Provided Methods

Called when a new item is started.

path will be empty if it is not being computed.

Called when an item is finished.

Implementors