Trait pw_stream::Read

source ·
pub trait Read {
    // Required method
    fn read(&mut self, buf: &mut [u8]) -> Result<usize>;

    // Provided method
    fn read_exact(&mut self, buf: &mut [u8]) -> Result<()> { ... }
}
Expand description

A trait for objects that provide streaming read capability.

Required Methods§

source

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

Read from a stream into a buffer.

Semantics match std::io::Read::read().

Provided Methods§

source

fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>

Read exactly enough bytes to fill the buffer.

Semantics match std::io::Read::read_exact().

Implementors§

source§

impl<T: AsRef<[u8]>> Read for Cursor<T>