Trait Writes

Source
pub trait Writes {
    // Required method
    fn write(&mut self, buf: &[u8]) -> Result<usize, StreamError>;

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

A thing that writes to a stream of bytes.

Required Methods§

Source

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

Writes bytes from buf, returning the number of bytes written.

No more than buf.len() bytes will be written.

If an error occurs, the number of bytes written is undefined.

Provided Methods§

Source

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

Writes all bytes from buf.

If an error occurs, the number of bytes written is undefined.

Implementors§

Source§

impl Writes for CryptoHasher

Source§

impl<T> Writes for T
where T: Write,