Skip to main content

StudyReader

Struct StudyReader 

pub struct StudyReader { /* private fields */ }
Expand description

A read-only snapshot of one study.

Construction performs only study_config and one storage snapshot request. In particular, it does not construct a sampler or scheduler and never invokes finalization recovery. Call refresh to replace the in-memory observation with a new read; the backing storage remains untouched.

Implementations§

§

impl StudyReader

pub fn backing_paths(&self) -> Option<Vec<PathBuf>>

Local source files protected from export replacement.

See Storage::backing_paths for the unknown-provenance contract.

pub fn new(storage: Arc<dyn Storage>, study: StudyId) -> Result<Self>

Reads study from storage without opening any writable seam.

§Errors

Error::NotFound if the study does not exist, or a storage/decoding error from the snapshot read.

pub fn load(storage: Arc<dyn Storage>, study: StudyId) -> Result<Self>

Alias emphasizing that this constructor loads an observer snapshot.

§Errors

The same errors as new.

pub fn from_storage(storage: Arc<dyn Storage>) -> Result<Self>

Reads the only study in storage through its catalog capability.

This convenience keeps one-study adapters from selecting a numeric id by convention. Ambiguous and empty catalogs remain typed outcomes.

§Errors

Error::Unsupported if the storage has no catalog capability; Error::NotFound for an empty catalog; and Error::Conflict for an ambiguous catalog.

pub const fn id(&self) -> StudyId

The observed study’s storage identity.

pub const fn study_id(&self) -> StudyId

Alias for id.

pub const fn config(&self) -> &StudyConfig

The persisted study configuration.

pub fn user_attrs(&self) -> Result<UserAttrs>

Reads the study’s user-owned metadata without opening a writable handle.

§Errors

A backend read error, including Error::Unsupported when study attributes are unavailable.

pub const fn view(&self) -> &StudyView

The observed trial snapshot.

pub const fn snapshot(&self) -> &StudySnapshot

The complete hydrated observation, including its consistency marker.

pub fn trial_fan(&self, trial: TrialId) -> Result<Option<ReplicateFan>>

Reads the persisted replicate fan for one trial, if present.

§Errors

Reserved for source compatibility with the former direct storage read; the immutable snapshot lookup itself is infallible.

pub fn pending_finalizations(&self) -> &[OutboxRecord]

Pending terminal finalizations, ordered by the backend’s stable outbox order and excluding fully completed (Done) records.

pub fn pending_outbox(&self) -> &[OutboxRecord]

pub fn policy_for(&self, name: &str) -> Result<Option<Open>>

Reads the persisted open-search policy for one parameter, if present.

This is a read-only configuration query used by inspection renderers; it does not register a policy or otherwise mutate the backend.

§Errors

Reserved for source compatibility with the former direct storage read; the immutable snapshot lookup itself is infallible.

pub const fn consistency(&self) -> SnapshotConsistency

Whether the backing backend provided one atomic read epoch.

pub fn refresh(&mut self) -> Result<()>

Replaces this observation with a fresh storage read.

No writable operation is performed. A study’s configuration is immutable after creation, so this reader retains the configuration it already paired with the observation and refreshes only the snapshot.

§Errors

A storage read or side-state decoding error. The existing observation remains unchanged when refreshing fails.

Trait Implementations§

§

impl Clone for StudyReader

§

fn clone(&self) -> StudyReader

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for StudyReader

§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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
§

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,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more