Skip to main content

Write

Trait Write 

Source
pub trait Write {
    // Required methods
    fn write(&mut self, buf: &[u8]);
    fn reserve(&mut self, additional: usize);
}
Expand description

A no_std compatible write trait used by facet serializers.

This trait provides a simple interface for writing bytes, designed to work in no_std environments while remaining compatible with standard library types.

Required Methods§

Source

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

Write all bytes from the buffer to the writer.

Source

fn reserve(&mut self, additional: usize)

If the writer supports it, reserve space for additional bytes.

This is an optimization hint and may be ignored by implementations.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Write for &mut Vec<u8>

Available on crate feature alloc only.
Source§

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

Source§

fn reserve(&mut self, additional: usize)

Source§

impl Write for Vec<u8>

Available on crate feature alloc only.
Source§

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

Source§

fn reserve(&mut self, additional: usize)

Implementors§