Struct SnapshotRequest
pub struct SnapshotRequest { /* private fields */ }Expand description
A request for one hydrated storage read.
Explicit scopes are read verbatim, even when they belong to another study;
this raw storage seam spans all studies. Typed
crate::study::StudySnapshot hydration owns one-study isolation. A
trial-state kind such as
"atune.constraints" requests Scope::Named(study, "<kind>.<trial-id>")
for every trial returned by the snapshot. Named prefixes let an exact
backend enumerate study-owned slots such as space policies without adding a
general public key-listing operation. The source-compatible default cannot
enumerate prefixes; callers using it should also supply every currently
known matching scope and retain the SnapshotConsistency::BestEffort
marker.
Implementations§
§impl SnapshotRequest
impl SnapshotRequest
pub fn new(study: StudyId) -> Self
pub fn new(study: StudyId) -> Self
Starts a full-study request at Cursor::BEGIN.
pub const fn after(self, cursor: Cursor) -> Self
pub const fn after(self, cursor: Cursor) -> Self
Reads deltas strictly after cursor instead of the whole study.
pub fn with_scope(self, scope: Scope) -> Self
pub fn with_scope(self, scope: Scope) -> Self
Adds one exact state scope.
pub fn with_scopes(self, scopes: impl IntoIterator<Item = Scope>) -> Self
pub fn with_scopes(self, scopes: impl IntoIterator<Item = Scope>) -> Self
Adds exact state scopes.
pub fn with_trial_state_kind(self, kind: impl Into<String>) -> Self
pub fn with_trial_state_kind(self, kind: impl Into<String>) -> Self
Adds one per-returned-trial named state kind.
pub const fn with_trial_scopes(self) -> Self
pub const fn with_trial_scopes(self) -> Self
Includes each returned trial’s historical Scope::Trial slot.
pub fn with_named_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_named_prefix(self, prefix: impl Into<String>) -> Self
Requests every Scope::Named slot in this study whose key begins
with prefix.
pub const fn with_outbox(self) -> Self
pub const fn with_outbox(self) -> Self
Includes this study’s durable finalization outbox records.
pub fn scopes(&self) -> impl Iterator<Item = &Scope>
pub fn scopes(&self) -> impl Iterator<Item = &Scope>
Exact requested state scopes, in deterministic order.
pub fn trial_state_kinds(&self) -> impl Iterator<Item = &str>
pub fn trial_state_kinds(&self) -> impl Iterator<Item = &str>
Per-returned-trial named state kinds, in deterministic order.
pub fn named_prefixes(&self) -> impl Iterator<Item = &str>
pub fn named_prefixes(&self) -> impl Iterator<Item = &str>
Named study-slot prefixes, in deterministic order.
pub const fn includes_trial_scopes(&self) -> bool
pub const fn includes_trial_scopes(&self) -> bool
Whether historical Scope::Trial values were requested.
pub const fn includes_outbox(&self) -> bool
pub const fn includes_outbox(&self) -> bool
Whether durable finalization outboxes were requested.
pub fn concrete_scopes(&self, deltas: &[TrialDelta]) -> BTreeSet<Scope>
pub fn concrete_scopes(&self, deltas: &[TrialDelta]) -> BTreeSet<Scope>
Expands exact and per-returned-trial selectors into concrete scopes.
Backend implementations use this after reading the trial deltas at their snapshot epoch. Named-prefix selectors still require backend enumeration and are intentionally not included here.
Trait Implementations§
§impl Clone for SnapshotRequest
impl Clone for SnapshotRequest
§fn clone(&self) -> SnapshotRequest
fn clone(&self) -> SnapshotRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more