[−][src]Struct cslice::CSlice
An immutable slice, equivalent to &'a T.
A CSlice can be constructed from a corresponding Rust slice via the AsCSlice trait.
A Rust slice can be constructed from a corresponding CSlice via as_ref.
Implementations
impl<'a, T> CSlice<'a, T>[src]
pub unsafe fn new(base: *const T, len: usize) -> Self[src]
Create a CSlice from raw data.
Safety
The region of memory from base (inclusive) to base + len * sizeof<T>
(exclusive) must be valid for the duration of lifetime 'a.
pub fn as_ptr(&self) -> *const T[src]
Produces a raw pointer to the slice's buffer.
pub fn len(&self) -> usize[src]
Returns the number of elements in the slice.
Trait Implementations
impl<'a, T> AsRef<[T]> for CSlice<'a, T>[src]
impl<'a, T: Clone> Clone for CSlice<'a, T>[src]
impl<'a, T: Copy> Copy for CSlice<'a, T>[src]
impl<'a, T> Index<usize> for CSlice<'a, T>[src]
impl<'a, T: Sync> Send for CSlice<'a, T>[src]
impl<'a, T: Sync> Sync for CSlice<'a, T>[src]
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for CSlice<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Unpin for CSlice<'a, T>
impl<'a, T> UnwindSafe for CSlice<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
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>,