Skip to main content

PerByteTracking

Trait PerByteTracking 

Source
trait PerByteTracking<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
    // Required methods
    fn excludes(bx: &mut Bx, ty: Ty<'tcx>) -> bool;
    fn contains(bx: &mut Bx, ty: Ty<'tcx>) -> bool;

    // Provided methods
    fn visit_layout(
        bx: &mut Bx,
        offset: Size,
        ranges: &mut RangeSet<Size>,
        layout: TyAndLayout<'tcx>,
        imprecise: bool,
    ) { ... }
    fn collect(
        bx: &mut Bx,
        layout: TyAndLayout<'tcx>,
        imprecise: bool,
    ) -> Vec<(Size, Size)> { ... }
}
Expand description

A visitor trait for collecting the ranges within a layout that satisfy a given predicate.

Required Methods§

Source

fn excludes(bx: &mut Bx, ty: Ty<'tcx>) -> bool

Indicates that we can exclude the range of bytes that contains this type. This tells us that PerByteTracking::contains is false for every field or variant without having to recurse any further into the layout of the type.

Source

fn contains(bx: &mut Bx, ty: Ty<'tcx>) -> bool

Indicates that we should include the range containing this type.

Provided Methods§

Source

fn visit_layout( bx: &mut Bx, offset: Size, ranges: &mut RangeSet<Size>, layout: TyAndLayout<'tcx>, imprecise: bool, )

Traverses through the layout of a type to find each range satisfying the predicate.

If imprecise is true, then the entire size of the type will be included, even if only one of its fields satisfies the predicate.

Source

fn collect( bx: &mut Bx, layout: TyAndLayout<'tcx>, imprecise: bool, ) -> Vec<(Size, Size)>

Collects the ranges within a type that satisfy the given predicate.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> PerByteTracking<'a, 'tcx, Bx> for UnsafeCellRanges

Source§

impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> PerByteTracking<'a, 'tcx, Bx> for UnsafePinnedRanges