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<FieldIdx, VariantIdx>(
        &self,
        a: Scalar,
        b: Scalar
    ) -> LayoutS<FieldIdx, VariantIdx>
       where FieldIdx: Idx,
             VariantIdx: Idx { ... }
    fn univariant<'a, FieldIdx, VariantIdx, F>(
        &self,
        dl: &TargetDataLayout,
        fields: &IndexSlice<FieldIdx, F>,
        repr: &ReprOptions,
        kind: StructKind
    ) -> Option<LayoutS<FieldIdx, VariantIdx>>
       where FieldIdx: Idx,
             VariantIdx: Idx,
             F: Deref<Target = &'a LayoutS<FieldIdx, VariantIdx>> + Debug { ... }
    fn layout_of_never_type<FieldIdx, VariantIdx>(
        &self
    ) -> LayoutS<FieldIdx, VariantIdx>
       where FieldIdx: Idx,
             VariantIdx: Idx { ... }
    fn layout_of_struct_or_enum<'a, FieldIdx, VariantIdx, F>(
        &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>>
       where FieldIdx: Idx,
             VariantIdx: Idx,
             F: Deref<Target = &'a LayoutS<FieldIdx, VariantIdx>> + Debug { ... }
    fn layout_of_union<'a, FieldIdx, VariantIdx, F>(
        &self,
        repr: &ReprOptions,
        variants: &IndexSlice<VariantIdx, IndexVec<FieldIdx, F>>
    ) -> Option<LayoutS<FieldIdx, VariantIdx>>
       where FieldIdx: Idx,
             VariantIdx: Idx,
             F: Deref<Target = &'a LayoutS<FieldIdx, VariantIdx>> + Debug { ... }
}

Required Associated Types§

Required Methods§

fn delay_bug(&self, txt: String)

fn current_data_layout(&self) -> Self::TargetDataLayoutRef

Provided Methods§

fn scalar_pair<FieldIdx, VariantIdx>( &self, a: Scalar, b: Scalar ) -> LayoutS<FieldIdx, VariantIdx>where FieldIdx: Idx, VariantIdx: Idx,

fn univariant<'a, FieldIdx, VariantIdx, F>( &self, dl: &TargetDataLayout, fields: &IndexSlice<FieldIdx, F>, repr: &ReprOptions, kind: StructKind ) -> Option<LayoutS<FieldIdx, VariantIdx>>where FieldIdx: Idx, VariantIdx: Idx, F: Deref<Target = &'a LayoutS<FieldIdx, VariantIdx>> + Debug,

fn layout_of_never_type<FieldIdx, VariantIdx>( &self ) -> LayoutS<FieldIdx, VariantIdx>where FieldIdx: Idx, VariantIdx: Idx,

fn layout_of_struct_or_enum<'a, FieldIdx, VariantIdx, F>( &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>>where FieldIdx: Idx, VariantIdx: Idx, F: Deref<Target = &'a LayoutS<FieldIdx, VariantIdx>> + Debug,

fn layout_of_union<'a, FieldIdx, VariantIdx, F>( &self, repr: &ReprOptions, variants: &IndexSlice<VariantIdx, IndexVec<FieldIdx, F>> ) -> Option<LayoutS<FieldIdx, VariantIdx>>where FieldIdx: Idx, VariantIdx: Idx, F: Deref<Target = &'a LayoutS<FieldIdx, VariantIdx>> + Debug,

Implementors§