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]
impl<T> Buffer<T>pub fn len(&self) -> usize[src]
pub fn len(&self) -> usizeNumber of elements in the buffer.
pub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> boolIs the buffer empty?
pub unsafe fn ptr(&self) -> *mut T[src]
pub unsafe fn ptr(&self) -> *mut TPointer to the first element in the buffer.
pub unsafe fn as_slice(&self) -> &[T][src]
pub unsafe fn as_slice(&self) -> &[T]Interprets contents as a slice.
Warning: Some memory might be uninitialized.
pub unsafe fn as_mut_slice(&mut self) -> &mut [T][src]
pub unsafe fn as_mut_slice(&mut self) -> &mut [T]Interprets contents as a mut slice.
Warning: Some memory might be uninitialized.
pub unsafe fn get(&self, i: usize) -> &T[src]
pub unsafe fn get(&self, i: usize) -> &TInterprets 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]
pub unsafe fn get_mut(&mut self, i: usize) -> &mut TInterprets 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]
pub fn new() -> SelfCreates a new empty Buffer.
pub unsafe fn from_raw_parts(ptr: *mut T, len: usize) -> Self[src]
pub unsafe fn from_raw_parts(ptr: *mut T, len: usize) -> Selfpub fn uninitialized(len: usize) -> Result<Self, ()>[src]
pub fn uninitialized(len: usize) -> Result<Self, ()>Create a mirrored buffer containing len Ts where the first half of
the buffer is mirrored into the second half.
Trait Implementations
impl<T> Drop for Buffer<T>[src]
impl<T> Drop for Buffer<T>impl<T> Clone for Buffer<T> where
T: Clone, [src]
impl<T> Clone for Buffer<T> where
T: Clone, fn clone(&self) -> Self[src]
fn clone(&self) -> SelfReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<T> Default for Buffer<T>[src]
impl<T> Default for Buffer<T>impl<T> Send for Buffer<T> where
T: Send, [src]
impl<T> Send for Buffer<T> where
T: Send, impl<T> Sync for Buffer<T> where
T: Sync, [src]
impl<T> Sync for Buffer<T> where
T: Sync,