pub trait AsRawSlice<T> {
// Required methods
fn ptr(&self) -> *const T;
fn length(&self) -> usize;
fn raw_slice(&self, begin: usize, len: usize) -> RawSlice<T>;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn first_and_last_ptrs(&self) -> [*const T; 2] { ... }
unsafe fn ptr_at(&self, position: usize) -> *const T { ... }
}
Expand description
A type that can be represented as a slice.
Required Methods§
Provided Methods§
Sourcefn first_and_last_ptrs(&self) -> [*const T; 2]
fn first_and_last_ptrs(&self) -> [*const T; 2]
Returns pointers to the first and last, (len-1)-th, element of the slice.
If the slice is empty, both pointers are null.