Skip to main content

Registry

Struct Registry 

Source
pub struct Registry {
    pub schema: u64,
    /* private fields */
}
Available on crate feature encoder only.
Expand description

The parsed, validated document.

Fields§

§schema: u64

Implementations§

Source§

impl Registry

Source

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.

Source

pub fn embedded() -> Arc<Registry> ⓘ

The snapshot embedded in the crate.

Source

pub fn variable(&self, variable_id: &str) -> Result<&VariableSpec>

Source

pub fn source(&self, model: &str) -> Result<&SourceSpec>

Source

pub fn source_by_manifest_model( &self, manifest_model: &str, ) -> Option<&SourceSpec>

The source whose manifest model string is manifest_model.

Source

pub fn bundle(&self, bundle_id: &str) -> Option<&BundleSpec>

Source

pub fn variables(&self) -> impl Iterator<Item = &VariableSpec>

Every variable, in document order.

Source

pub fn sources(&self) -> impl Iterator<Item = &SourceSpec>

Every source, in document order.

Source

pub fn codebook(&self, profile: &str, variable_id: &str) -> Result<Codebook>

One profile’s codebook for one variable.

Source

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.

Source

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.

Source

pub fn knows_profile(&self, profile: &str) -> bool

Whether any published variable has a codebook under profile.

Source

pub fn is_static(&self, variable_id: &str) -> bool

Whether a variable is time-invariant; an unregistered id is not.

Source

pub fn is_raw(&self, variable_id: &str) -> Result<bool>

Whether a variable’s chunks stack RAW rather than chaining.

Source

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.

Source

pub fn vector_components(&self, bundle_id: &str) -> Option<(&str, &str)>

The two component variables of a vector bundle, or None.

Source

pub fn composite_components(&self, bundle_id: &str) -> Option<&[String]>

A composite’s components, or None for any other bundle.

Source

pub fn volume_components(&self, bundle_id: &str) -> Option<&[String]>

A volume’s members, or None for any other bundle.

Source

pub fn derivation(&self, bundle_id: &str) -> Option<&Derivation>

The derivation of a bundle the converter computes, or None.

Source

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.

Source

pub fn is_derived_vector(&self, bundle_id: &str) -> bool

Whether a vector bundle is derived rather than read.

Source

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.

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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§

Source§

impl Debug for Registry

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Registry

§

impl Freeze for Registry

§

impl Move for Registry

§

impl RefUnwindSafe for Registry

§

impl Send for Registry
where RawTable<(String, VariableSpec)>: Send, RawVecInner: Send, RawTable<(String, BundleSpec)>: Send, RawTable<(String, SourceSpec)>: Send,

§

impl Sync for Registry
where RawTable<(String, VariableSpec)>: Sync, RawVecInner: Sync, RawTable<(String, BundleSpec)>: Sync, RawTable<(String, SourceSpec)>: Sync,

§

impl Unpin for Registry
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for Registry

§

impl UnwindSafe for Registry
where HashMap<String, VariableSpec>: UnwindSafe, RawVecInner: UnwindSafe, HashMap<String, BundleSpec>: UnwindSafe, HashMap<String, SourceSpec>: UnwindSafe,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.