Skip to main content

ExternalContext

Struct ExternalContext 

Source
pub struct ExternalContext { /* private fields */ }
Expand description

A binding whose semantic layer is not reachable from here — held by a service that answers the questions itself, or simply not pulled onto this machine.

It is well-formed, so ContextLoader::is_parseable holds and the compiler’s coarse floor passes: the binding resolved, there is just no local MDL behind it. Beyond that it answers nothing. Every precondition against it comes back unanswerable rather than false, which is the point — a profile bound this way cannot quietly gate on schema facts nobody checked, and an author who wants such a gate is told to bind a context that can answer it instead.

This is what makes an offline delegating profile honest. Reporting empty collections without declining the probes would be worse than useless: has_metric would evaluate to a confident false about a layer this process has never seen.

Implementations§

Source§

impl ExternalContext

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl ContextLoader for ExternalContext

Source§

fn is_parseable(&self) -> bool

Whether the bound semantic layer assembled and parsed. Backs mdl_parseable / wren_project_exists.
Source§

fn metrics(&self) -> &[MetricInfo]

All queryable metrics (declared cube measures + implicit numeric columns).
Source§

fn dimensions(&self) -> &[DimensionInfo]

All groupable / queryable dimensions (cube dimensions + selectable columns).
Source§

fn time_dimensions(&self) -> &[DimensionInfo]

Time dimensions — the temporal subset that satisfies has_time_dimension.
Source§

fn models(&self) -> &[ModelInfo]

All models in the layer.
Source§

fn lineage(&self) -> &LineageGraph

The semantic lineage DAG (for lineage_resolvable, and as the graph an impact refers to).
Source§

fn can_answer(&self, _predicate: &str) -> bool

Capability probe: can this Context answer predicate at all? A false here is a different loud-fail from evaluating the predicate false — it means the semantic format cannot carry the answer, so the compiler must refuse rather than guess. Read more
Source§

fn parse_error(&self) -> Option<&str>

The underlying parse/assembly failure text, when 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 model(&self, name: &str) -> Option<&ModelInfo>

A single model by name.
Source§

fn host_analysis(&self) -> Option<HostAnalysis>

This layer’s own impact analysis, when it has one. Read more
Source§

fn source_introspectable(&self) -> Option<bool>

Raw-shape probe (constitutive family): whether the bound raw source can have its schema introspected (the precondition 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 a semantic-layer loader, which cannot answer raw-shape at all, is unaffected; a raw-source adapter overrides it (schema introspection is borrowed — dlt/wren — never built).
Source§

fn raw_docs_readable(&self) -> Option<bool>

Raw-shape probe (constitutive family): whether readable raw business docs back a knowledge enrichment (the precondition raw_docs_readable). Same Some/None semantics as Self::source_introspectable; defaults to None (MDL-only adapters cannot answer it).
Source§

fn lineage_diagnostics(&self) -> &[String]

Human-readable notes about where lineage construction had to degrade (e.g. a consumer’s SQL failed to parse and a cruder text scan was used, or a malformed consumer file was skipped). Surfaced into the IR’s resolved binding so a thinner-than-authored graph is never silent (no silent caps). Defaults to empty: an adapter with nothing to confess reports nothing.
Source§

fn metric_additivity(&self, metric: &str) -> Option<Additivity>

Additivity of a declared metric, or None when the metric is not declared or its additivity is not expressible (⇒ can_answer("metric_additive") is false for it).
Source§

impl Debug for ExternalContext

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ExternalContext

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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, 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.