pub struct Registry {
pub schema: u64,
/* private fields */
}encoder only.Expand description
The parsed, validated document.
Fields§
§schema: u64Implementations§
Source§impl Registry
impl Registry
Sourcepub fn parse(text: &str) -> Result<Arc<Registry>>
pub fn parse(text: &str) -> Result<Arc<Registry>>
Parse and validate one document, refusing the whole of it on the first problem, with the field and value named.
pub fn variable(&self, variable_id: &str) -> Result<&VariableSpec>
pub fn source(&self, model: &str) -> Result<&SourceSpec>
Sourcepub fn source_by_manifest_model(
&self,
manifest_model: &str,
) -> Option<&SourceSpec>
pub fn source_by_manifest_model( &self, manifest_model: &str, ) -> Option<&SourceSpec>
The source whose manifest model string is manifest_model.
pub fn bundle(&self, bundle_id: &str) -> Option<&BundleSpec>
Sourcepub fn variables(&self) -> impl Iterator<Item = &VariableSpec>
pub fn variables(&self) -> impl Iterator<Item = &VariableSpec>
Every variable, in document order.
Sourcepub fn codebook(&self, profile: &str, variable_id: &str) -> Result<Codebook>
pub fn codebook(&self, profile: &str, variable_id: &str) -> Result<Codebook>
One profile’s codebook for one variable.
Sourcepub fn series_codebook(&self, variable_id: &str) -> Option<&Codebook>
pub fn series_codebook(&self, variable_id: &str) -> Option<&Codebook>
The variable’s series codebook (seriesQuantization), if it has one;
an unregistered id has none.
Sourcepub fn series_widened_ids(
&self,
series_bundle_ids: &[String],
bundle_ids: Option<&[String]>,
) -> Vec<String>
pub fn series_widened_ids( &self, series_bundle_ids: &[String], bundle_ids: Option<&[String]>, ) -> Vec<String>
The variables whose series-store codes are sixteen-bit: every
variable of series_bundle_ids (those of bundle_ids alone on a
restricted build) that has a series codebook, in that order. The
reference’s series_widened_ids, over the same document.
Sourcepub fn knows_profile(&self, profile: &str) -> bool
pub fn knows_profile(&self, profile: &str) -> bool
Whether any published variable has a codebook under profile.
Sourcepub fn is_static(&self, variable_id: &str) -> bool
pub fn is_static(&self, variable_id: &str) -> bool
Whether a variable is time-invariant; an unregistered id is not.
Sourcepub fn is_raw(&self, variable_id: &str) -> Result<bool>
pub fn is_raw(&self, variable_id: &str) -> Result<bool>
Whether a variable’s chunks stack RAW rather than chaining.
Sourcepub fn bundle_variable_ids(&self, bundle_id: &str) -> Vec<String>
pub fn bundle_variable_ids(&self, bundle_id: &str) -> Vec<String>
The variables one bundle carries, in bundle order: a scalar’s own, a vector’s pair, a composite’s components, a volume’s levels.
Sourcepub fn vector_components(&self, bundle_id: &str) -> Option<(&str, &str)>
pub fn vector_components(&self, bundle_id: &str) -> Option<(&str, &str)>
The two component variables of a vector bundle, or None.
Sourcepub fn composite_components(&self, bundle_id: &str) -> Option<&[String]>
pub fn composite_components(&self, bundle_id: &str) -> Option<&[String]>
A composite’s components, or None for any other bundle.
Sourcepub fn volume_components(&self, bundle_id: &str) -> Option<&[String]>
pub fn volume_components(&self, bundle_id: &str) -> Option<&[String]>
A volume’s members, or None for any other bundle.
Sourcepub fn derivation(&self, bundle_id: &str) -> Option<&Derivation>
pub fn derivation(&self, bundle_id: &str) -> Option<&Derivation>
The derivation of a bundle the converter computes, or None.
Sourcepub fn scalar_derivation(&self, bundle_id: &str) -> Option<&Derivation>
pub fn scalar_derivation(&self, bundle_id: &str) -> Option<&Derivation>
The derivation of a scalar the per-frame stage computes from other planes (the equivalent potential temperature, the precipitation type, the turbulence index); the precipitation rate is the per-file stage’s and is not one.
Sourcepub fn is_derived_vector(&self, bundle_id: &str) -> bool
pub fn is_derived_vector(&self, bundle_id: &str) -> bool
Whether a vector bundle is derived rather than read.
Sourcepub fn vector_input_ids(&self, bundle_id: &str) -> Vec<String>
pub fn vector_input_ids(&self, bundle_id: &str) -> Vec<String>
The source inputs one vector bundle is built from: a wind pair is its own two components, a derived pair its derivation’s inputs.
Sourcepub fn bundle_input_ids(
&self,
source: &SourceSpec,
bundle_id: &str,
) -> Vec<String>
pub fn bundle_input_ids( &self, source: &SourceSpec, bundle_id: &str, ) -> Vec<String>
The source input variables one published bundle is built from. A composite reads its producer’s inputs less the optional ones the source does not fetch; the precipitation rate reads the first of its derivation’s inputs the source lists.
Sourcepub fn derived_precipitation(
&self,
source: &SourceSpec,
) -> Result<Option<(String, String)>>
pub fn derived_precipitation( &self, source: &SourceSpec, ) -> Result<Option<(String, String)>>
The precipitation-rate bundle a source derives in its per-file
stage, as (bundle id, raw input id): the listed scalar whose
derivation is the rate, on a source whose precipitation arrives
accumulated, averaged, as an interval total or as a window’s.
None on a source that reads the rate as it is.
Sourcepub fn interval_precipitation_pairs(
&self,
source: &SourceSpec,
) -> Vec<(String, String)>
pub fn interval_precipitation_pairs( &self, source: &SourceSpec, ) -> Vec<(String, String)>
The further rates a source derives from interval totals beside its
one precipitation rate, as (bundle id, raw input id), those whose
total this build reads (SourceSpec::interval_precipitation_pairs).
Sourcepub fn bundle_first_hour(
&self,
source: &SourceSpec,
bundle_id: &str,
) -> Option<i64>
pub fn bundle_first_hour( &self, source: &SourceSpec, bundle_id: &str, ) -> Option<i64>
The forecast hour a bundle’s series starts at when its inputs are
absent from every earlier frame (SourceSpec::variable_first_hours):
the latest of its inputs’, None for a bundle whose inputs are in
every frame.
Sourcepub fn bundle_has_step(&self, source: &SourceSpec, bundle_id: &str) -> bool
pub fn bundle_has_step(&self, source: &SourceSpec, bundle_id: &str) -> bool
Whether a bundle is read from an input written only every so many
hours (SourceSpec::variable_step_hours): its axis is then its own.
Sourcepub fn bundle_is_cadenced(&self, source: &SourceSpec, bundle_id: &str) -> bool
pub fn bundle_is_cadenced(&self, source: &SourceSpec, bundle_id: &str) -> bool
Whether a bundle is read from an input some frame past the analysis
may lack by the source’s cadence rules (SourceSpec::is_cadenced).
Sourcepub fn bundle_carried_at(
&self,
source: &SourceSpec,
bundle_id: &str,
hour: i64,
) -> bool
pub fn bundle_carried_at( &self, source: &SourceSpec, bundle_id: &str, hour: i64, ) -> bool
Whether a bundle has a frame at hour by its inputs’ cadence rules:
every input is carried there. Mirrors bundle_carried_at in
xuebuild/discover.py.
Sourcepub fn ensemble(
&self,
source: &SourceSpec,
variable_id: &str,
) -> Result<Option<EnsembleIdentity>>
pub fn ensemble( &self, source: &SourceSpec, variable_id: &str, ) -> Result<Option<EnsembleIdentity>>
The ensemble block a variable is written with on a source: the
source’s own for it (SourceSpec::ensembles), else the variable’s.
Sourcepub fn published_bundle_ids<'a>(&self, source: &'a SourceSpec) -> Vec<&'a str>
pub fn published_bundle_ids<'a>(&self, source: &'a SourceSpec) -> Vec<&'a str>
Every bundle a source can publish, in manifest order: its scalars, then each listed vector whose inputs it fetches, then each listed composite whose producer’s channels it fetches, then each listed volume whose members it fetches. A derived scalar counts the same way — listed, it ships only when its inputs are.
Sourcepub fn analysis_optional_ids<'a>(
&self,
source: &SourceSpec,
scalar_ids: &[&'a str],
) -> Vec<&'a str>
pub fn analysis_optional_ids<'a>( &self, source: &SourceSpec, scalar_ids: &[&'a str], ) -> Vec<&'a str>
The published scalars of scalar_ids whose series has no analysis
frame: the rate a source derives by de-accumulating, de-averaging
or differencing a window, and any scalar read from a record the
source lists under optional_at_analysis.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Registry
impl Freeze for Registrywhere
*const u8 is !null: Freeze,
PhantomData<(String, VariableSpec)>: Freeze,
PhantomData<String>: Freeze,
PhantomData<(String, BundleSpec)>: Freeze,
PhantomData<(String, SourceSpec)>: Freeze,
impl Move for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registrywhere
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, VariableSpec)>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<(String, BundleSpec)>: UnsafeUnpin,
PhantomData<(String, SourceSpec)>: UnsafeUnpin,
impl UnwindSafe for Registrywhere
HashMap<String, VariableSpec>: UnwindSafe,
RawVecInner: UnwindSafe,
HashMap<String, BundleSpec>: UnwindSafe,
HashMap<String, SourceSpec>: UnwindSafe,
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