Struct slice_ring_buffer::Buffer[][src]

pub struct Buffer<T> { /* fields omitted */ }
Expand description

Mirrored memory buffer of length len.

The buffer elements in range [0, len/2) are mirrored into the range [len/2, len).

Implementations

Number of elements in the buffer.

Is the buffer empty?

Pointer to the first element in the buffer.

Interprets contents as a slice.

Warning: Some memory might be uninitialized.

Interprets contents as a mut slice.

Warning: Some memory might be uninitialized.

Interprets content as a slice and access the i-th element.

Warning: The memory of the i-th element might be uninitialized.

Interprets content as a mut slice and access the i-th element.

Warning: The memory of the i-th element might be uninitialized.

Creates a new empty Buffer.

Creates a new empty Buffer from a ptr and a len.

Panics

If ptr is null.

Total number of bytes in the buffer.

Create a mirrored buffer containing len Ts where the first half of the buffer is mirrored into the second half.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.