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)
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>)
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§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more