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, 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§

source

fn delayed_bug(&self, txt: impl Into<Cow<'static, str>>)

source

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

Provided Methods§

source

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

source

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,

source

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

source

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,

source

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,

Object Safety§

This trait is not object safe.

Implementors§