[][src]Struct yukikaze::utils::BytesWriter

pub struct BytesWriter { /* fields omitted */ }

Convenience wrapper over bytes::BytesMut

Provides io::Write that automatically resizes.

Methods

impl BytesWriter[src]

pub fn new() -> Self[src]

Creates new instance with default capacity 4096

pub fn with_smol_capacity() -> Self[src]

Creates new instance with smol capacity 64

pub fn with_capacity(capacity: usize) -> Self[src]

Creates new instance with provided capacity

pub fn into_inner(self) -> BytesMut[src]

Converts into underlying bytes::BytesMut

pub fn freeze(&mut self) -> Bytes[src]

Converts into bytes::Bytes

pub fn len(&self) -> usize[src]

Returns buffer length.

pub fn split_off(&mut self, at: usize) -> Self[src]

Splits off, the same as bytes::BytesMut::split_off

pub fn reserve(&mut self, add: usize)[src]

Reserve extra memory, the same as bytes::BytesMut::reserve

Trait Implementations

impl Write for BytesWriter[src]

Auto Trait Implementations

impl Sync for BytesWriter

impl Send for BytesWriter

impl Unpin for BytesWriter

impl UnwindSafe for BytesWriter

impl RefUnwindSafe for BytesWriter

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<W> WriteBytesExt for W where
    W: Write + ?Sized