Struct slice_deque::Buffer

source ·
pub struct Buffer<T> { /* private fields */ }
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.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.