pub trait TRead {
// Required methods
fn peek_byte(&self) -> Result<u8, StreamError>;
fn peek(&self, buffer: &mut [u8]) -> Result<usize, StreamError>;
fn read_byte(&mut self) -> Result<u8, StreamError>;
fn read(&mut self, buffer: &mut [u8]) -> Result<usize, StreamError>;
fn skip(&mut self, count: usize) -> usize;
fn skip_all(&mut self) -> usize;
fn view(&self) -> &[u8] ⓘ;
fn available(&self) -> usize;
}Required Methods§
Sourcefn peek_byte(&self) -> Result<u8, StreamError>
fn peek_byte(&self) -> Result<u8, StreamError>
Peek one byte from stream, position don’t shift.
Can return EOF error.
Sourcefn peek(&self, buffer: &mut [u8]) -> Result<usize, StreamError>
fn peek(&self, buffer: &mut [u8]) -> Result<usize, StreamError>
Peek bytes from stream, position don’t shift.
Can return EOF, ZeroLength errors.
Sourcefn read_byte(&mut self) -> Result<u8, StreamError>
fn read_byte(&mut self) -> Result<u8, StreamError>
Read one byte from stream, position shifted.
Can return EOF error.