Struct repc_impl::layout::TypeLayout[][src]

pub struct TypeLayout {
    pub size_bits: u64,
    pub field_alignment_bits: u64,
    pub pointer_alignment_bits: u64,
    pub required_alignment_bits: u64,
}
Expand description

The computed layout of a type.

Fields

size_bits: u64

The size of the type in bits.

This is the value returned by sizeof and C and std::mem::size_of in Rust (but in bits instead of bytes). This is a multiple of pointer_alignment_bits.

field_alignment_bits: u64

The alignment of the type, in bits, when used as a field in a record.

This is usually the value returned by _Alignof in C, but there are some edge cases in GCC where _Alignof returns a smaller value.

pointer_alignment_bits: u64

The alignment, in bits, of valid pointers to this type.

This is the value returned by std::mem::align_of in Rust (but in bits instead of bytes). size_bits is a multiple of this value.

required_alignment_bits: u64

The required alignment of the type in bits.

This value is only used by MSVC targets. It is 8 on all other targets. On MSVC targets, this value restricts the effects of #pragma pack except in some cases involving bit-fields.

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

Returns the “default value” for a type. Read more

Performs the conversion.

The type used to encode the layout of the type itself.

The type used to encode the layout of a field in a record.

The type used to encode the layout of an opaque type.

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.