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§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl<R: Read> BlockingRead for R
Available on crate feature std only.Blanket implementation that allows any std::io::Read implementation to be used seamlessly as
BlockingRead.
impl<R: Read> BlockingRead for R
Available on crate feature
std only.Blanket implementation that allows any std::io::Read implementation to be used seamlessly as BlockingRead.