Skip to main content

RunCounter

Struct RunCounter 

Source
pub struct RunCounter { /* private fields */ }
Expand description

Per-run counting state for one (constraint, head) run.

The backend loops feed every visible row to the mode’s observe_* method (Self::observe_rows, Self::observe_distinct_terms, or Self::observe_distinct_graphs); Self::total is the run length to emit as DomainScanCountHit::count. Only the mode’s own counters are maintained; no term is decoded on any mode’s behalf (Rows never needs one, and the distinct modes compare or store the term’s encoded bytes — raw region bytes, so payloads are never validated; see the module-level corruption contract).

Implementations§

Source§

impl RunCounter

Source

pub fn new(mode: DomainCountMode) -> Self

Fresh counter for one run of mode; totals start at zero.

Source

pub fn observe_rows(&mut self)

Fold one visible row in DomainCountMode::Rows.

Source

pub fn observe_distinct_terms(&mut self, key: &[u8], slot2: &Range<usize>)

Fold one visible row in DomainCountMode::DistinctTerms.

slot2 locates the slot-2 term inside key — the component directly after the head, contiguous per head, so “differs from the previous row’s region” is exactly “new distinct term”.

Source

pub fn observe_distinct_graphs(&mut self, graph: &[u8])

Fold one visible row in DomainCountMode::DistinctGraphs: graph is the G region (slot-2 end to logical-prefix end; empty for the default graph).

Source

pub fn total(&self) -> u64

Run length to emit as DomainScanCountHit::count.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,