pub struct SpectralResultBundle { /* private fields */ }Expand description
Reopened spectral bundle. Manifest metadata is eager; arrays/checkpoint are verified
when requested. result caches an immutable owned result shared through Arc.
Ordinary bundles must use ResultBundle. Failed exports keep an .inprogress
directory and never publish a complete manifest at the requested destination.
§Example
use fpm_rs::{Result, reconstruction::SpectralReconstructionResult,
tabular::parquet::{BundleExportOptions, read_spectral_bundle}};
fn persist(result: &SpectralReconstructionResult) -> Result<()> {
let bundle = result.write_bundle("spectral-result", BundleExportOptions::default())?;
let reopened = read_spectral_bundle(bundle.path())?;
reopened.verify()?;
assert_eq!(reopened.result()?.channels.len(), result.channels.len());
Ok(())
}Implementations§
Source§impl SpectralResultBundle
impl SpectralResultBundle
Sourcepub fn read(path: impl AsRef<Path>) -> Result<Self>
pub fn read(path: impl AsRef<Path>) -> Result<Self>
Validates kind/version, unique safe artifact paths, shapes, metadata and required roles.
Sourcepub fn artifacts(&self) -> &BTreeMap<String, BundleArtifact>
pub fn artifacts(&self) -> &BTreeMap<String, BundleArtifact>
Borrows verified manifest descriptors, sorted by semantic role.
Sourcepub fn checkpoint(&self) -> Result<SpectralReconstructionCheckpoint>
pub fn checkpoint(&self) -> Result<SpectralReconstructionCheckpoint>
Loads the lossless resumable state, checking hash and exact manifest metadata.
Sourcepub fn result(&self) -> Result<Arc<SpectralReconstructionResult>>
pub fn result(&self) -> Result<Arc<SpectralReconstructionResult>>
Loads per-channel NPY fields, amplitudes, phases, spectra and fixed pupils. Returned arrays preserve saved binary64 values and are cached together.
Sourcepub fn joint_result(&self) -> Result<Option<MultiWavelengthSolverResult>>
pub fn joint_result(&self) -> Result<Option<MultiWavelengthSolverResult>>
Restores the authoritative joint OPD result and initialization records, or None for AP.
Sourcepub fn unwrapped_opd(&self) -> Result<Option<OpticalPathDifferenceResult>>
pub fn unwrapped_opd(&self) -> Result<Option<OpticalPathDifferenceResult>>
Restores optional synthetic-wavelength diagnostic arrays, including invalid NaN pixels.
Sourcepub fn verify(&self) -> Result<BundleVerificationResult>
pub fn verify(&self) -> Result<BundleVerificationResult>
Checks every hash, numerical state and table against authoritative manifest records.
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Releases the cached result; subsequent reads verify and reload its arrays.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SpectralResultBundle
impl RefUnwindSafe for SpectralResultBundle
impl Send for SpectralResultBundle
impl Sync for SpectralResultBundle
impl Unpin for SpectralResultBundle
impl UnsafeUnpin for SpectralResultBundle
impl UnwindSafe for SpectralResultBundle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more