Crate netbuf [] [src]

This module currently includes single Buf struct for holding buffers. Comparing to Vec class buffer has different allocation policy and has a marker of consumed data (i.e. already processed by protocol parser or already written to socket)

The Buf is deemed good both for input and output network buffer.

It also contains helper methods read_from and write_to which are used to read and append bytes from stream that implements Read and write bytes from buffer to a stream which implements Write respectively.

Note there are basically three ways to fill the buffer:

In other words you should use:

More documentation is found in Buf object itself

Structs

Buf

A buffer object to be used for reading from network

Enums

RangeArgument

Temporary type until the one in stdlib it made stable

Constants

MAX_BUF_SIZE

Maximum size of buffer allowed. Note: we assert on this size. Most network servers should set their own limits to something much smaller.