#[repr(C)]
pub struct slice_boxed_Layout<T>where
    T: ReprC,
    NonNullOwned<T>: ConcreteReprC,
    usize: ConcreteReprC,
{ pub ptr: CLayoutOf<NonNullOwned<T>>, pub len: CLayoutOf<usize>, }
Available on crate feature alloc only.
Expand description

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.

Fields

ptr: CLayoutOf<NonNullOwned<T>>

Pointer to the first element (if any).

len: CLayoutOf<usize>

Element count

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.