Struct static_reflect::builtins::AsmOption [−][src]
#[repr(C)]pub struct AsmOption<T> { /* fields omitted */ }
Expand description
A FFI-safe alternative to Rust’s std::option::Option.
Unlike the Rust type, this does not use the null-pointer optimization.
NOTE: This type doesn’t implement Drop.
Safety
This type does not enforce its safety variants,
just like AsmSlice. However, the first field must be
a valid bool
.
A valid type can only be in one of two states:
{present: false, value: undefined}
{present: false, value: any}
Implementations
The offset of the ‘present’ field
This should be zero, regardless of the inner type
The offset of the value field
This should be equal to the type’s alignment
Assume that this option is valid
This type is often used to ferry things across FFI boundaries, so it’s the callers repsonsibility to be safe with it.
Safety
The caller assumes that the underlying memory is valid. If not, undefined behavior will result.
If the value of the option is present.
Trait Implementations
This is an owned value, so it’s safe to send