Skip to main content

Writer

Trait Writer 

Source
pub trait Writer {
    // Required method
    fn write(&mut self, buf: &[u8]);

    // Provided methods
    fn write_len(&mut self, buf: &[u8], len: &mut usize) { ... }
    fn write_base64(&mut self, bytes: &[u8]) { ... }
}
Expand description

A byte sink: a buffer, a hash context or a HeaderFolder.

Required Methods§

Source

fn write(&mut self, buf: &[u8])

Appends buf.

Provided Methods§

Source

fn write_len(&mut self, buf: &[u8], len: &mut usize)

Appends buf and adds its length to len.

Source

fn write_base64(&mut self, bytes: &[u8])

Appends bytes encoded as standard Base64 with padding (RFC 4648 Section 4).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Writer for &mut Vec<u8>

Source§

fn write(&mut self, buf: &[u8])

Source§

impl Writer for Context

Source§

fn write(&mut self, data: &[u8])

Source§

impl Writer for Vec<u8>

Source§

fn write(&mut self, buf: &[u8])

Implementors§

Source§

impl<'x, W: Writer> Writer for HeaderFolder<'x, W>