Crate buffer [−] [src]
buffer
provides safe, write-only and generics-free byte buffers that can
be used without initializing them first.
The main trait of this library is Buffer
that represents a type that can
contain uninitialized bytes (such as Vec
, ArrayVec
, etc.) and can
safely be read into (e.g. using ReadBuffer
).
In order to keep code sizes down, such a type implementing Buffer
is
quickly converted into the struct BufferRef
, so this is the type
receivers of types implementing Buffer
s should work with.
An example for the usage of this trait can be found with ReadBuffer
which
implements reading into a buffer without initializing it first.
Structs
ArrayVecBuffer |
The intermediate step from a |
BufferRef |
A reference to an uninitialized or partially initialized byte buffer. |
BufferRefBuffer |
The intermediate step from a |
CapAt |
The result of a |
CapAtBuffer |
The intermediate step from a |
CapacityError |
An error occuring when too many bytes are being pushed into a buffer. |
SliceBuffer |
The intermediate step from a byte slice to a |
SliceRefBuffer |
The intermediate step from a byte slice reference to a |
VecBuffer |
The intermediate step from a |
Traits
Buffer |
Trait for types that can act as buffer for bytes. |
ReadBuffer |
Trait to read to |
ReadBufferRef |
An internal trait to be implemented by |
ToBufferRef |
Internal trait for the intermediate result of converting a |
Functions
read_buffer_ref⚠ |
A utility function for unsafely implementing |
with_buffer |
Convenience function that converts a |