Skip to main content

ExecScopedAccess

Struct ExecScopedAccess 

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

SRD-89 §3b / SRD-90 §M6 — scope every read to its reading execution by injecting exec_id as a uniform dimensional-label matcher, so each interior backend applies it wherever exec_id lives (the in-memory tier’s label set, the sqlite tier’s exec_id column) with the same value. This replaces the per-backend special-casing (the live tier’s bespoke post-filter, a sqlite selection mode) with one mechanism: exec_id is just a label.

None (single-run / outside any execution scope) ⇒ no injection — the read is unscoped and sees the sole execution’s data, byte-identical to before (axiom A1). If the caller already constrained exec_id, nothing is injected.

Implementations§

Source§

impl ExecScopedAccess

Source

pub fn new(inner: Arc<dyn MetricAccess>) -> Self

Trait Implementations§

Source§

impl MetricAccess for ExecScopedAccess

Source§

fn select_range( &self, matchers: &[Matcher], start_ms: i64, end_ms: i64, ) -> Result<Vector, QueryError>

Range selection: series matching every matcher, with every sample in [start_ms, end_ms] (ascending). Yields a range vector — the input a rollup (rate(m[w]), *_over_time) consumes. This is the one required method; select_instant derives from it.
Source§

fn select_instant( &self, matchers: &[Matcher], at_ms: i64, lookback_ms: Option<i64>, ) -> Result<Vector, QueryError>

Instant selection: series matching every matcher, each reduced to its latest sample within [at_ms - lookback, at_ms] (the PromQL stale-tolerance window; lookback_ms = None means a strict [at_ms, at_ms]). Yields an instant vector — one sample per series. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.