Struct diny::buffer::BufferState[][src]

pub struct BufferState<const LEN: usize> {
    pub cur: BufferCursor,
    // some fields omitted
}
Expand description

A convenient struct to represent serialization of an underlying byte buffer.

Generally useful for primitive times (e.g. u64, str) that need to serialize multiple bytes using a predetermined buffer.

Fields

cur: BufferCursor

Implementations

Initialize a new buffer state with the contents of the provided buf.

Initialize a new buffer state with the contents of the first n bytes of the provided buf.

Initialize a new buffer state and zeroize its contents.

Return a slice referencing the entire contents of the buffer.

Return whether or not more data is expected to be processed.

Return the number of bytes that have been processed so far.

Return whether or not any bytes have been processed yet.

Extend the size of the interal buffer window to acoomodate more data.

This will only extend the buffer up to the size of the pre-allocated buffer. It is intended to be used when the total number of bytes is not known ahead of time and will be deserialized as part of the buffer transfer.

Attempt to write all remaining bytes from the buffer.

Attempt to read all remaining bytes into the buffer.

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

Performs the conversion.

Performs the conversion.

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.