[][src]Struct safer_ffi::slice::slice_boxed

#[repr(C)]pub struct slice_boxed<T> { /* fields omitted */ }

Box<[T]> (fat pointer to a slice), 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<T> slice_boxed<T>[src]

pub fn as_ref<'borrow>(&'borrow self) -> slice_ref<'borrow, T>[src]

pub fn as_mut<'borrow>(&'borrow mut self) -> slice_mut<'borrow, T>[src]

pub fn as_slice<'borrow>(&'borrow self) -> &'borrow [T][src]

pub fn as_slice_mut<'borrow>(&'borrow mut self) -> &'borrow mut [T][src]

Trait Implementations

impl<T: Debug> Debug for slice_boxed<T>[src]

impl<T> Default for slice_boxed<T>[src]

impl<T> Deref for slice_boxed<T>[src]

type Target = [T]

The resulting type after dereferencing.

impl<T> DerefMut for slice_boxed<T>[src]

impl<T> Drop for slice_boxed<T>[src]

impl<T: Eq> Eq for slice_boxed<T>[src]

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

impl<T: Hash> Hash for slice_boxed<T>[src]

impl<T> Into<Box<[T]>> for slice_boxed<T>[src]

impl<T: Ord> Ord for slice_boxed<T>[src]

impl<T: PartialEq> PartialEq<slice_boxed<T>> for slice_boxed<T>[src]

impl<T: PartialOrd> PartialOrd<slice_boxed<T>> for slice_boxed<T>[src]

impl<T> ReprC for slice_boxed<T> where
    NonNullOwned<T>: ReprC,
    <NonNullOwned<T> as ReprC>::CLayout: CType<OPAQUE_KIND = Concrete>,
    usize: ReprC,
    <usize as ReprC>::CLayout: CType<OPAQUE_KIND = Concrete>,
    T: ReprC
[src]

type CLayout = slice_boxed_Layout<T>

The CType having the same layout as Self.

impl<T> Send for slice_boxed<T> where
    Box<[T]>: Send
[src]

impl<T> Sync for slice_boxed<T> where
    Box<[T]>: Sync
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for slice_boxed<T> where
    T: RefUnwindSafe

impl<T> Unpin for slice_boxed<T> where
    T: Unpin

impl<T> UnwindSafe for slice_boxed<T> where
    T: RefUnwindSafe + UnwindSafe

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, 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.