[−][src]Struct slice_deque::Buffer
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) -> *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 size_in_bytes(len: usize) -> usize
[src]
Total number of bytes in the buffer.
pub fn uninitialized(len: usize) -> Result<Self, AllocError>
[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> Default for Buffer<T>
[src]
impl<T> Sync for Buffer<T> where
T: Sync,
[src]
T: Sync,
impl<T> Clone for Buffer<T> where
T: Clone,
[src]
T: Clone,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T> Drop for Buffer<T>
[src]
impl<T> Send for Buffer<T> where
T: Send,
[src]
T: Send,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,