Struct rustc::ty::layout::Struct [] [src]

pub struct Struct {
    pub align: Align,
    pub packed: bool,
    pub sized: bool,
    pub offset_after_field: Vec<Size>,
}
Unstable (rustc_private)

A structure, a product type in ADT terms.

Fields

align: Align
Unstable (rustc_private)
packed: bool
Unstable (rustc_private)

If true, no alignment padding is used.

sized: bool
Unstable (rustc_private)

If true, the size is exact, otherwise it's only a lower bound.

offset_after_field: Vec<Size>
Unstable (rustc_private)

Offsets for the first byte after each field. That is, field_offset(i) = offset_after_field[i - 1] and the whole structure's size is the last offset, excluding padding.

Methods

impl<'a, 'gcx, 'tcx> Struct
[src]

fn new(dl: &TargetDataLayout, packed: bool) -> Struct

fn extend<I>(&mut self, dl: &TargetDataLayout, fields: I, scapegoat: Ty<'gcx>) -> Result<()LayoutError<'gcx>> where I: Iterator<Item=Result<&'a LayoutLayoutError<'gcx>>>

Unstable (rustc_private)

Extend the Struct with more fields.

fn min_size(&self) -> Size

Unstable (rustc_private)

Get the size without trailing alignment padding.

fn stride(&self) -> Size

Unstable (rustc_private)

Get the size with trailing aligment padding.

fn would_be_zero_sized<I>(dl: &TargetDataLayout, fields: I) -> Result<boolLayoutError<'gcx>> where I: Iterator<Item=Result<&'a LayoutLayoutError<'gcx>>>

Unstable (rustc_private)

Determine whether a structure would be zero-sized, given its fields.

fn non_zero_field_in_type(infcx: &InferCtxt<'a, 'gcx, 'tcx>, ty: Ty<'gcx>) -> Result<Option<FieldPath>, LayoutError<'gcx>>

Unstable (rustc_private)

Find the path leading to a non-zero leaf field, starting from the given type and recursing through aggregates.

fn non_zero_field_path<I>(infcx: &InferCtxt<'a, 'gcx, 'tcx>, fields: I) -> Result<Option<FieldPath>, LayoutError<'gcx>> where I: Iterator<Item=Ty<'gcx>>

Unstable (rustc_private)

Find the path leading to a non-zero leaf field, starting from the given set of fields and recursing through aggregates.

Trait Implementations

Derived Implementations

impl Debug for Struct
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Hash for Struct
[src]

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl Eq for Struct
[src]

impl PartialEq for Struct
[src]

fn eq(&self, __arg_0: &Struct) -> bool

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

fn ne(&self, __arg_0: &Struct) -> bool

This method tests for !=.