Enum repc_impl::layout::Annotation[][src]

pub enum Annotation {
    PragmaPack(u64),
    AttrPacked,
    Align(Option<u64>),
}
Expand description

An annotation of a type or field.

Builtin types, arrays, and opaque types cannot be annotated.

Variants

PragmaPack(u64)

Tuple Fields

0: u64

The PragmaPack annotation.

This cannot be used on fields. At most one of these can be used on a type.

If the argument is n, it corresponds to #pragma pack(n/8) in C. If n is not a multiple of 8, this annotation will be ignored.

AttrPacked

The AttrPacked annotation.

This corresponds to __attribute__((packed)) in C. On MSVC targets, the behavior is the behavior of Clang.

Align(Option<u64>)

Tuple Fields

0: Option<u64>

The Aligned annotation.

If the argument is Some(n), n must be a power of two and at least 8. It is the corresponding C argument but in bits instead of bytes.

If the argument is Some(n), it corresponds to __declspec(align(n/8)) on MSVC targets and __attribute__((aligned(n/8))) otherwise.

If the argument is None, it corresponds to __attribute__((aligned)). On MSVC targets, the behavior is the behavior of Clang.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.