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:

  1. {present: false, value: undefined}
  2. {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

An option with no value

Create an option with a value

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

Formats the value using the given formatter. Read more

Performs the conversion.

The static information about the type’s representation

This is an owned value, so it’s safe to send

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

Performs the conversion.

Performs the conversion.

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.