Struct iobuf::IORingbuf [] [src]

pub struct IORingbuf { /* fields omitted */ }

A ring buffer implemented with Iobufs.

Methods

impl IORingbuf
[src]

Creates a new ring buffer, with room for cap bytes.

Returns an Iobuf, whose window may be filled with new data. This acts as the "push" operations for the ringbuf.

It is easy to get garbage data if using a clone of the returned Iobuf. This is not memory-unsafe, but should be avoided.

Returns an Iobuf, whose window may be have data consumed out of it. This acts as the "pop" operation for the ringbuf.

After emptying out the returned Iobuf, it is not necessarily true that the ringbuf is empty. To truly empty out the ringbuf, you must pop Iobufs in a loop until is_empty returns true.

It is easy to get garbage data if using a clone of the returned Iobuf. This is not memory-unsafe, but should be avoided.

true if there is no data to pop in the Iobuf.

true if there is no room for new data in the Iobuf.