Expand description
Traits to work with bytes.
This module contains two traits:
Bytesto work a single buffer, e.g.Vec<u8>, andBytesVectoredto work with multiple buffers and using vectored I/O, e.g.Vec<Vec<u8>>.
The basic design of both traits is the same and is fairly simple. It’s split
into two methods. Usage starts with a call to as_bytes/as_bufs,
which returns a slice to unitialised bytes. The caller should then fill that
slice with valid bytes, e.g. by receiving bytes from a socket. Once the
slice is (partially) filled the caller should call
update_length/update_lengths, which updates the length of the
buffer.
Structs
Wrapper to limit the number of bytes
B can use.A version of
IoSliceMut that allows the buffer to be uninitialised.Traits
Trait to make easier to work with uninitialised buffers.
Trait to make easier to work with uninitialised buffers using vectored I/O.