pub struct MdlContext { /* private fields */ }Expand description
A ContextLoader backed by a wren MDL manifest. Built once from an assembled manifest; all
accessors return borrowed, pre-projected data (pure, sans-IO).
Implementations§
Source§impl MdlContext
impl MdlContext
Sourcepub fn from_sources(sources: &ProjectSources) -> Self
pub fn from_sources(sources: &ProjectSources) -> Self
Build from assembled project sources. On assembly failure returns an unparseable context
(rather than an error) so the compiler can evaluate mdl_parseable/wren_project_exists
to false and loud-fail with a precondition message, per the sans-IO probe model. The
underlying LoadError text is discarded here — use Self::try_from_sources (or catch
the error and call Self::unparseable_with_error) when the caller wants it surfaced.
Sourcepub fn try_from_sources(sources: &ProjectSources) -> Result<Self, LoadError>
pub fn try_from_sources(sources: &ProjectSources) -> Result<Self, LoadError>
Build from an assembled project, surfacing the assembly error to the host if it wants it.
Sourcepub fn unparseable() -> Self
pub fn unparseable() -> Self
An empty, non-parseable context (bound project missing or malformed), with no detail on
why — used when the caller has no LoadError to hand (e.g. no wren project directory
found at all).
Sourcepub fn unparseable_with_error(parse_error: Option<String>) -> Self
pub fn unparseable_with_error(parse_error: Option<String>) -> Self
An empty, non-parseable context carrying the real assembly failure text (from
Self::try_from_sources’s Err), so the host can surface why the bound project didn’t
parse instead of only the generic mdl_parseable floor message.
Sourcepub fn from_manifest(manifest: &Manifest) -> Self
pub fn from_manifest(manifest: &Manifest) -> Self
Project a parsed manifest into the Info types + lineage.
Trait Implementations§
Source§impl ContextLoader for MdlContext
impl ContextLoader for MdlContext
Source§fn is_parseable(&self) -> bool
fn is_parseable(&self) -> bool
mdl_parseable /
wren_project_exists.Source§fn parse_error(&self) -> Option<&str>
fn parse_error(&self) -> Option<&str>
Self::is_parseable is false and the
adapter has one to offer (e.g. a serde error from the bound project’s manifest). Message-only
enrichment for the mdl_parseable precondition failure — never used for control flow.
Defaults to None (no detail beyond the generic floor message); an adapter that keeps the
real error around overrides it.Source§fn metrics(&self) -> &[MetricInfo]
fn metrics(&self) -> &[MetricInfo]
Source§fn dimensions(&self) -> &[DimensionInfo]
fn dimensions(&self) -> &[DimensionInfo]
Source§fn time_dimensions(&self) -> &[DimensionInfo]
fn time_dimensions(&self) -> &[DimensionInfo]
has_time_dimension.Source§fn lineage(&self) -> &LineageGraph
fn lineage(&self) -> &LineageGraph
lineage_resolvable + blast_radius).Source§fn lineage_diagnostics(&self) -> &[String]
fn lineage_diagnostics(&self) -> &[String]
Source§fn source_introspectable(&self) -> Option<bool>
fn source_introspectable(&self) -> Option<bool>
source_introspectable). This inverts the consumer probes
above: a constitutive component’s input is a raw source that has no MDL yet — the component’s
output is the MDL. Some(true) = introspectable, Some(false) = a raw source is bound but
not introspectable, None = this Context cannot answer raw-shape at all (an MDL-only adapter),
which the compiler turns into an unanswerable loud-fail rather than guessing (the same
distinction metric_additive draws). Defaults to None so existing MDL adapters are unaffected;
a raw-source adapter overrides it (schema introspection is borrowed — dlt/wren — never built).Source§fn raw_docs_readable(&self) -> Option<bool>
fn raw_docs_readable(&self) -> Option<bool>
raw_docs_readable). Same Some/None semantics as
Self::source_introspectable; defaults to None (MDL-only adapters cannot answer it).Source§fn metric_additivity(&self, metric: &str) -> Option<Additivity>
fn metric_additivity(&self, metric: &str) -> Option<Additivity>
None when the metric is not declared or its
additivity is not expressible (⇒ can_answer("metric_additive") is false for it).