Skip to main content

Writer

Trait Writer 

Source
pub trait Writer: Sealed {
    // Required method
    fn write_bytes(&mut self, data: &[u8]) -> Result<(), DiagError>;
}
Expand description

Abstraction over alloc and no-alloc write targets.

Implemented for:

  • &mut [u8] - no-alloc, fixed-size buffer, advances cursor on write
  • bytes::BytesMut - alloc, growable buffer (feature = “alloc”)

Sealed to prevent downstream implementations.

Required Methods§

Source

fn write_bytes(&mut self, data: &[u8]) -> Result<(), DiagError>

Implementations on Foreign Types§

Source§

impl Writer for &mut [u8]

Source§

fn write_bytes(&mut self, data: &[u8]) -> Result<(), DiagError>

Implementors§