kvarn_utils

Struct WriteableBytes

source
pub struct WriteableBytes { /* private fields */ }
Expand description

A writeable Bytes.

Has a special allocation method for optimized usage in Kvarn.

Implementations§

source§

impl WriteableBytes

source

pub fn new() -> Self

Creates a new writeable buffer. Consider using Self::with_capacity() if you can estimate the capacity needed.

source

pub fn with_capacity(capacity: usize) -> Self

Crates a new writeable buffer with a specified capacity.

source

pub fn into_inner(self) -> BytesMut

Turns self into BytesMut when you are done writing.

Trait Implementations§