#[repr(C)]
pub struct slice_mut_Layout<'lt, T>where
    T: 'lt,
    T: ReprC,
    NonNullMut<T>: ConcreteReprC,
    usize: ConcreteReprC,
    PhantomData<&'lt ()>: ConcreteReprC,
{ pub ptr: CLayoutOf<NonNullMut<T>>, pub len: CLayoutOf<usize>, pub _lt: CLayoutOf<PhantomData<&'lt ()>>, }
Expand description

&'lt mut [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.

Fields

ptr: CLayoutOf<NonNullMut<T>>

Pointer to the first element (if any).

len: CLayoutOf<usize>

Element count

_lt: CLayoutOf<PhantomData<&'lt ()>>

Trait Implementations

Optional marshaler attached to the type (e.g., [MarshalAs(UnmanagedType.FunctionPtr)]) Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
The CType having the same layout as Self.
Sanity checks that can be performed on an instance of the CType layout. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Applies the Compat adapter by value. Read more
Applies the Compat adapter by shared reference. Read more
Applies the Compat adapter by mutable reference. Read more
Available on crate feature alloc only.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Available on crate feature headers only.