#[repr(C)]
pub union InlineStorage<A, const N: usize> {
    /* private fields */
}
This is supported on crate feature unstable only.
Expand description

An N-wide, partially initialized byte array with the alignment of A.

Examples

Note that its size in memory is always a multiple of its alignment, so it is recommended to chose N accordingly:

use core::mem::{align_of, size_of};
use coca::object::{InlineStorage, Align16};
assert_eq!(align_of::<InlineStorage<Align16, 10>>(), 16);

assert_eq!(size_of::<InlineStorage<Align16, 10>>(), 16);
assert_eq!(size_of::<InlineStorage<Align16, 16>>(), 16);
assert_eq!(size_of::<InlineStorage<Align16, 20>>(), 32);

Trait Implementations

Returns the maximum number of items the memory block can hold. Read more

Extracts a pointer to the beginning of the memory block. Read more

Extracts a mutable pointer to the beginning of the memory block. 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

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