pub struct OutBuffer<'a, C> where
    C: WriteBuf + ?Sized
{ pub dst: &'a mut C, /* private fields */ }
Expand description

Wrapper around an output buffer.

C is usually either [u8] or Vec<u8>.

Bytes will be written starting at dst[pos].

pos will be updated after writing.

Invariant

pos <= dst.capacity()

Fields

dst: &'a mut C

Implementations

Returns a new OutBuffer around the given slice.

Starts with pos = 0.

Returns a new OutBuffer around the given slice, starting at the given position.

Panics

If pos >= dst.capacity().

Returns the current cursor position.

Sets the new cursor position.

Panics

If pos > self.dst.capacity().

Safety

Data up to pos must have actually been written to.

Returns the part of this buffer that was written to.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.