Skip to main content

MeasurementStore

Struct MeasurementStore 

Source
pub struct MeasurementStore { /* private fields */ }

Implementations§

Source§

impl MeasurementStore

Source

pub fn open(path: impl Into<PathBuf>) -> Result<Self, ProjectError>

Source

pub fn new(path: impl Into<PathBuf>, project: Project) -> Self

Source

pub fn project(&self) -> &Project

Source

pub fn project_mut(&mut self) -> &mut Project

Source

pub fn records(&self) -> Vec<MeasurementRecord>

Source

pub fn entry_for(&self, pos: i64) -> Option<MeasurementRecord>

Source

pub fn done_positions(&self, roles: Option<&[String]>) -> Vec<i64>

Source

pub fn pending_positions(&self, positions: &[i64], roles: &[String]) -> Vec<i64>

Source

pub fn label_for(&self, pos: i64) -> String

Source

pub fn start_position(&mut self, pos: i64) -> MeasurementRecord

Source

pub fn record( &mut self, result: MeasurementResult, plan_roles: Option<&[String]>, ) -> Result<MeasurementRecord, ProjectError>

Writes the IR and its source sidecar, enters the result into its position (upstream session.record), and saves the project once.

A result with a source also sets source[role] on the entry, where upstream’s importer (step5.load_mdat) sets it after recording: the key goes last when the entry has none, and a value that is not an object is replaced by one.

Source

pub fn clear_position(&mut self, pos: i64) -> bool

Removes a position’s entries and SNR values; false if it had none.

Source

pub fn remove_position(&mut self, pos: i64) -> Option<RemovedPosition>

Takes a position’s entries and SNR values out of the store, keeping them for Self::restore_position. None if the position has no entry. The project file is not written.

Source

pub fn restore_position( &mut self, removed: RemovedPosition, ) -> Result<(), ProjectError>

Puts a removed position back; fails if that position was recorded again meanwhile. Each entry returns to its old list index (or the end, if the list is shorter now). The project file is not written.

Source

pub fn ir_path_of( &mut self, role: &str, pos: i64, ) -> Result<PathBuf, ProjectError>

Source

pub fn ir_of( &mut self, role: &str, pos: i64, ) -> Result<(Vec<f32>, u32), ProjectError>

Source

pub fn source_of(&mut self, role: &str, pos: i64) -> Option<SourceInfo>

Returns a recorded IR’s source sidecar when both files are readable and confined to the project’s .irs directory.

Source

pub fn replace_source( &mut self, role: &str, pos: i64, info: Option<&SourceInfo>, ) -> Result<(), ProjectError>

Rewrites a recorded IR’s source sidecar and updates its in-memory calibration fingerprint. The IR and measurement entry are unchanged.

Source

pub fn t0_of(&self, role: &str, pos: i64) -> f64

Source

pub fn t0_by_role(&self, pos: i64) -> BTreeMap<String, f64>

Source

pub fn irs_by_role( &mut self, pos: i64, ) -> Result<BTreeMap<String, (Vec<f32>, u32)>, ProjectError>

Source

pub fn warnings(&self) -> &[MigrationWarning]

Source

pub fn save(&mut self) -> Result<(), ProjectError>

Source

pub fn save_count(&self) -> u64

How many times this store has written its project file. A test hook: tests count saves with it.

Trait Implementations§

Source§

impl Debug for MeasurementStore

Source§

fn fmt(&self, f: &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
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

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, 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.