Struct lrs::ringbuf::DynRingBuf

A resizable ring buffer.

Syntax

struct DynRingBuf<T, Heap = Libc>
    where Heap: Allocator,
{
    /* private fields */
}

Static methods

NameDescription
buffered

Creates a ring buffer which is backed by borrowed memory.

new

Creates a new ring buffer.

with_capacity

Creates a new ring buffer and reserves a certain amount of space for it.

with_pool

Creates a new ring buffer with a memory pool.

Methods

ReceiverNameDescription
&selfavailable

Returns the number of available but unused slots.

&selfcapacity

Returns the capacity of the ring buffer.

&mut selfclear
&selfiter

Creates an iterator over the elements in the ringbuffer.

&selflen

Returns the number of elements in the ring buffer.

&mut selfpop_left

Removes an element from the left end of the ring buffer.

&mut selfpop_right

Removes an element from the rght end of the ring buffer.

&mut selfpush_left

Appends an element to the left end of the ring buffer.

&mut selfpush_right

Appends an element to the right end of the ring buffer.

&mut selfreserve

Reserves memory for additional elements.

&mut selftry_push_left

Tries to append an element to the right end of the ring buffer.

&mut selftry_push_right

Tries to append an element to the right end of the ring buffer.

Trait implementations

NameDescription
Debug

Objects that can be formatted in a "debug" form.

Drop

Objects with a destructor.

Eq (2 times)

Objects that implement the binary == and != operators.

Index

Objects that implement the immutable subscript operator.

IndexMut

Objects that implement the mutable subscript operator.

MaybeClone

Objects that can be duplicated.

Send

Objects whose ownership can be moved from one thread to another.

Sync

Objects that allow immutable access from threads other than their owning thread.

UndefState

Types that are not valid when they contain certain bit patterns.