Struct slice_deque::Buffer
[−]
[src]
pub struct Buffer<T> { /* fields omitted */ }
Mirrored memory buffer of length len
.
The buffer elements in range [0, len/2)
are mirrored into the range
[len/2, len)
.
Methods
impl<T> Buffer<T>
[src]
pub fn len(&self) -> usize
[src]
Number of elements in the buffer.
pub fn is_empty(&self) -> bool
[src]
Is the buffer empty?
pub unsafe fn ptr(&self) -> NonZero<*mut T>
[src]
Pointer to the first element in the buffer.
pub unsafe fn as_slice(&self) -> &[T]
[src]
Interprets contents as a slice.
Warning: Some memory might be uninitialized.
pub unsafe fn as_mut_slice(&mut self) -> &mut [T]
[src]
Interprets contents as a mut slice.
Warning: Some memory might be uninitialized.
pub unsafe fn get(&self, i: usize) -> &T
[src]
Interprets content as a slice and access the i
-th element.
Warning: The memory of the i
-th element might be uninitialized.
pub unsafe fn get_mut(&mut self, i: usize) -> &mut T
[src]
Interprets content as a mut slice and access the i
-th element.
Warning: The memory of the i
-th element might be uninitialized.
pub fn new() -> Self
[src]
Creates a new empty Buffer
.
pub unsafe fn from_raw_parts(ptr: *mut T, len: usize) -> Self
[src]
pub fn uninitialized(len: usize) -> Result<Self, ()>
[src]
Create a mirrored buffer containing len
T
s where the first half of
the buffer is mirrored into the second half.
Trait Implementations
impl<T> Drop for Buffer<T>
[src]
impl<T> Clone for Buffer<T> where
T: Clone,
[src]
T: Clone,
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more