[][src]Struct safer_ffi::slice::slice_ref

#[repr(C)]pub struct slice_ref<'lt, T> where
    T: 'lt, 
{ /* fields omitted */ }

&'lt [T] but with a guaranteed #[repr(C)] layout.

C layout (for some given type T)

typedef struct {
    // Cannot be NULL
    T * ptr;
    size_t len;
} slice_T;

Nullable pointer?

If you want to support the above typedef, but where the ptr field is allowed to be NULL (with the contents of len then being undefined) use the Option< slice_ptr<_> > type.

C Layout

Implementations

impl<'lt, T: 'lt> slice_ref<'lt, T>[src]

pub fn as_slice(self: slice_ref<'lt, T>) -> &'lt [T][src]

Trait Implementations

impl<'lt, T: 'lt> Clone for slice_ref<'lt, T>[src]

impl<'lt, T: 'lt> Copy for slice_ref<'lt, T>[src]

impl<'_, T: Debug> Debug for slice_ref<'_, T>[src]

impl<'_, T> Default for slice_ref<'_, T>[src]

impl<'lt, T: 'lt> Deref for slice_ref<'lt, T>[src]

type Target = [T]

The resulting type after dereferencing.

impl<'_, T: Eq> Eq for slice_ref<'_, T>[src]

impl<'lt, T: 'lt> From<&'lt [T]> for slice_ref<'lt, T>[src]

impl<'lt, T: 'lt> From<slice_mut<'lt, T>> for slice_ref<'lt, T>[src]

impl<'lt, T: 'lt> From<slice_ref<'lt, T>> for slice_raw<T>[src]

impl<'_, T: Hash> Hash for slice_ref<'_, T>[src]

impl<'_, T: Ord> Ord for slice_ref<'_, T>[src]

impl<'_, T: PartialEq> PartialEq<slice_ref<'_, T>> for slice_ref<'_, T>[src]

impl<'_, T: PartialOrd> PartialOrd<slice_ref<'_, T>> for slice_ref<'_, T>[src]

impl<'lt, T> ReprC for slice_ref<'lt, T> where
    NonNullRef<T>: ReprC,
    <NonNullRef<T> as ReprC>::CLayout: CType<OPAQUE_KIND = Concrete>,
    usize: ReprC,
    <usize as ReprC>::CLayout: CType<OPAQUE_KIND = Concrete>,
    PhantomData<&'lt ()>: ReprC,
    <PhantomData<&'lt ()> as ReprC>::CLayout: CType<OPAQUE_KIND = Concrete>,
    T: ReprC,
    T: 'lt, 
[src]

type CLayout = slice_ref_Layout<'lt, T>

The CType having the same layout as Self.

impl<'lt, T: 'lt> Send for slice_ref<'lt, T> where
    &'lt [T]: Send
[src]

impl<'lt, T: 'lt> Sync for slice_ref<'lt, T> where
    &'lt [T]: Sync
[src]

Auto Trait Implementations

impl<'lt, T> RefUnwindSafe for slice_ref<'lt, T> where
    T: RefUnwindSafe

impl<'lt, T> Unpin for slice_ref<'lt, T>

impl<'lt, T> UnwindSafe for slice_ref<'lt, T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.