pub trait LayoutCalculator {
type TargetDataLayoutRef: Borrow<TargetDataLayout>;
// Required methods
fn delay_bug(&self, txt: String);
fn current_data_layout(&self) -> Self::TargetDataLayoutRef;
// Provided methods
fn scalar_pair(&self, a: Scalar, b: Scalar) -> LayoutS { ... }
fn univariant(
&self,
dl: &TargetDataLayout,
fields: &IndexSlice<FieldIdx, Layout<'_>>,
repr: &ReprOptions,
kind: StructKind
) -> Option<LayoutS> { ... }
fn layout_of_never_type(&self) -> LayoutS { ... }
fn layout_of_struct_or_enum(
&self,
repr: &ReprOptions,
variants: &IndexSlice<VariantIdx, IndexVec<FieldIdx, Layout<'_>>>,
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> { ... }
fn layout_of_union(
&self,
repr: &ReprOptions,
variants: &IndexSlice<VariantIdx, IndexVec<FieldIdx, Layout<'_>>>
) -> Option<LayoutS> { ... }
}