Struct bipbuffer::BipBuffer [] [src]

pub struct BipBuffer<T> { /* fields omitted */ }

A Bip-Buffer object

Methods

impl<T: Default> BipBuffer<T>
[src]

Creates and allocates a new buffer of T elements

Clears all regions and reservations

Data in the underlying buffer is unchanged

Returns a mutable buffer containing up to length slots for storing data.

If there is less free space than requested, the buffer size will equal the free space. Returns Error if there is no free space

Commits the data in the reservation, allowing it to be read later

If a length of 0 is passed in, the reservation will be cleared without making any other changes

Retrieves available (committed) data as a contiguous block.

Returns None if there is no data available

Marks the first length elements of the available data is seen.

The next time read() is called, it will not include these elements.

Number of committed elements

This approximates the size of the buffer that will be returned on read()

Number of reserved elements

This is the amount of available space for writing data to the buffer

Size of the backing store

Uses len() * size_of(T) + 6 * size_of(usize) memory overall

Whether any space has been reserved or committed in the buffer

Trait Implementations

impl<T: Debug> Debug for BipBuffer<T>
[src]

Formats the value using the given formatter.