Trait rustc_abi::layout::LayoutCalculator
source · pub trait LayoutCalculator {
type TargetDataLayoutRef: Borrow<TargetDataLayout>;
// Required methods
fn delayed_bug(&self, txt: impl Into<Cow<'static, str>>);
fn current_data_layout(&self) -> Self::TargetDataLayoutRef;
// Provided methods
fn scalar_pair<FieldIdx: Idx, VariantIdx: Idx>(
&self,
a: Scalar,
b: Scalar,
) -> LayoutS<FieldIdx, VariantIdx> { ... }
fn univariant<'a, FieldIdx: Idx, VariantIdx: Idx, F: Deref<Target = &'a LayoutS<FieldIdx, VariantIdx>> + Debug>(
&self,
dl: &TargetDataLayout,
fields: &IndexSlice<FieldIdx, F>,
repr: &ReprOptions,
kind: StructKind,
) -> Option<LayoutS<FieldIdx, VariantIdx>> { ... }
fn layout_of_never_type<FieldIdx: Idx, VariantIdx: Idx>(
&self,
) -> LayoutS<FieldIdx, VariantIdx> { ... }
fn layout_of_struct_or_enum<'a, FieldIdx: Idx, VariantIdx: Idx, F: Deref<Target = &'a LayoutS<FieldIdx, VariantIdx>> + Debug>(
&self,
repr: &ReprOptions,
variants: &IndexSlice<VariantIdx, IndexVec<FieldIdx, F>>,
is_enum: bool,
is_unsafe_cell: bool,
scalar_valid_range: (Bound<u128>, Bound<u128>),
discr_range_of_repr: impl Fn(i128, i128) -> (Integer, bool),
discriminants: impl Iterator<Item = (VariantIdx, i128)>,
dont_niche_optimize_enum: bool,
always_sized: bool,
) -> Option<LayoutS<FieldIdx, VariantIdx>> { ... }
fn layout_of_union<'a, FieldIdx: Idx, VariantIdx: Idx, F: Deref<Target = &'a LayoutS<FieldIdx, VariantIdx>> + Debug>(
&self,
repr: &ReprOptions,
variants: &IndexSlice<VariantIdx, IndexVec<FieldIdx, F>>,
) -> Option<LayoutS<FieldIdx, VariantIdx>> { ... }
}
Required Associated Types§
Required Methods§
fn delayed_bug(&self, txt: impl Into<Cow<'static, str>>)
fn current_data_layout(&self) -> Self::TargetDataLayoutRef
Provided Methods§
fn scalar_pair<FieldIdx: Idx, VariantIdx: Idx>( &self, a: Scalar, b: Scalar, ) -> LayoutS<FieldIdx, VariantIdx>
fn univariant<'a, FieldIdx: Idx, VariantIdx: Idx, F: Deref<Target = &'a LayoutS<FieldIdx, VariantIdx>> + Debug>( &self, dl: &TargetDataLayout, fields: &IndexSlice<FieldIdx, F>, repr: &ReprOptions, kind: StructKind, ) -> Option<LayoutS<FieldIdx, VariantIdx>>
fn layout_of_never_type<FieldIdx: Idx, VariantIdx: Idx>( &self, ) -> LayoutS<FieldIdx, VariantIdx>
fn layout_of_struct_or_enum<'a, FieldIdx: Idx, VariantIdx: Idx, F: Deref<Target = &'a LayoutS<FieldIdx, VariantIdx>> + Debug>( &self, repr: &ReprOptions, variants: &IndexSlice<VariantIdx, IndexVec<FieldIdx, F>>, is_enum: bool, is_unsafe_cell: bool, scalar_valid_range: (Bound<u128>, Bound<u128>), discr_range_of_repr: impl Fn(i128, i128) -> (Integer, bool), discriminants: impl Iterator<Item = (VariantIdx, i128)>, dont_niche_optimize_enum: bool, always_sized: bool, ) -> Option<LayoutS<FieldIdx, VariantIdx>>
fn layout_of_union<'a, FieldIdx: Idx, VariantIdx: Idx, F: Deref<Target = &'a LayoutS<FieldIdx, VariantIdx>> + Debug>( &self, repr: &ReprOptions, variants: &IndexSlice<VariantIdx, IndexVec<FieldIdx, F>>, ) -> Option<LayoutS<FieldIdx, VariantIdx>>
Object Safety§
This trait is not object safe.