Expand description
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 Buffers 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§
- Array
VecBuffer - The intermediate step from a
ArrayVecto aBufferRef. - Buffer
Ref - A reference to an uninitialized or partially initialized byte buffer.
- Buffer
RefBuffer - The intermediate step from a
BufferRefto anotherBufferRef. - CapAt
- The result of a
cap_atcall on a buffer. - CapAt
Buffer - The intermediate step from a
CapAtto aBufferRef. - Capacity
Error - An error occuring when too many bytes are being pushed into a buffer.
- Slice
Buffer - The intermediate step from a byte slice to a
BufferRef. - Slice
RefBuffer - The intermediate step from a byte slice reference to a
BufferRef. - VecBuffer
- The intermediate step from a
Vecto aBufferRef.
Traits§
- Buffer
- Trait for types that can act as buffer for bytes.
- Read
Buffer - Trait to read to
T: Buffer. - Read
Buffer Marker - An internal trait to be implemented by
T: Readwhich do not access the read buffer inRead::read. - Read
Buffer Ref - An internal trait to be implemented by
T: Readwhich do not access the read buffer inRead::read. Prefer implementingReadBufferMarkerover this. - ToBuffer
Ref - Internal trait for the intermediate result of converting a
T: Bufferinto aBufferRef.
Functions§
- read_
buffer_ ⚠ref - A utility function for unsafely implementing
ReadBufferReffor readers that don’t read the buffer passed toRead::read. - with_
buffer - Convenience function that converts a
T: Bufferinto aBufferRef.