BlockingRead

Trait BlockingRead 

Source
pub trait BlockingRead {
    type Error: Error;

    // Required method
    fn read(&mut self) -> Result<Option<u8>, Self::Error>;
}
Expand description

BlockingRead is the library’s abstraction for blocking read I/O.

It is similar to std:io::Read, and there is a blanket implementation of BlockingRead for any implementation of Read. The reason for introducing BlockingRead is that it allows json-streaming in a no-std environment.

Note that json-streaming reads data from a BlockingRead in many small chunks without any I/O buffering. It is the client’s responsibility to use std::io::BufRead or similar for improved performance where desired.

Required Associated Types§

Required Methods§

Source

fn read(&mut self) -> Result<Option<u8>, Self::Error>

Implementors§

Source§

impl<R: Read> BlockingRead for R

Blanket implementation that allows any std::io::Read implementation to be used seamlessly as BlockingRead.