pub struct Elaborator<'a> { /* private fields */ }Expand description
The current state of a notebook elaboration session.
We feed a notebook into this cell-by-cell.
Implementations§
Source§impl<'a> Elaborator<'a>
impl<'a> Elaborator<'a>
Source§impl<'a> Elaborator<'a>
Instance-notebook elaboration: cells presenting an instance of a model,
elaborated to a fiber record packaged as an Instance — the
same target as the text elaborator’s instance NAME : X := [...] path,
whose instance_body_inner is the blueprint for everything here. The
fiber helpers are deliberate near-duplicates of their text-side namesakes
with typed errors; extracting a shared core is planned once the error
channels unify.
impl<'a> Elaborator<'a>
Instance-notebook elaboration: cells presenting an instance of a model,
elaborated to a fiber record packaged as an Instance — the
same target as the text elaborator’s instance NAME : X := [...] path,
whose instance_body_inner is the blueprint for everything here. The
fiber helpers are deliberate near-duplicates of their text-side namesakes
with typed errors; extracting a shared core is planned once the error
channels unify.
Sourcepub fn instance_notebook<'b>(
&mut self,
codomain: &RecordV,
cells: impl Iterator<Item = &'b InstanceJudgment>,
) -> (FiberTyS, FiberTyV)
pub fn instance_notebook<'b>( &mut self, codomain: &RecordV, cells: impl Iterator<Item = &'b InstanceJudgment>, ) -> (FiberTyS, FiberTyV)
Elaborate the cells of an instance notebook against the codomain
model, producing the instance as a fiber record — the notebook
analogue of the text elaborator’s instance_body.
The codomain is bound under CODOMAIN_BINDER and each of its
fields is pushed into the base scope as a variable projecting out of
that binding, so cell references to codomain objects and morphisms
(UUID-qualified names) resolve through the ordinary
Self::resolve_name machinery — including modal objects in over
and paths through model instantiations. Generators and imports go to
the separate fiber scope, exactly as in the text pipeline. Unlike the
text pipeline, a bad cell does not abort the instance: the error is
recorded against the cell and elaboration continues.
Sourcepub fn instance_document(
&mut self,
doc: &InstanceDocumentContent,
) -> Option<Instance>
pub fn instance_document( &mut self, doc: &InstanceDocumentContent, ) -> Option<Instance>
Elaborate an instance document into a top-level instance declaration.
Resolves the document’s instanceOf link to a model previously
declared in the toplevel (mirroring how instantiation cells resolve
their links), elaborates the cells against it, and packages the
result exactly as the text pipeline does — ready for
instance_from_def.
Returns None (with an error recorded) if the codomain link cannot
be resolved at all; cell-level problems are recorded per-cell in
Self::errors and still produce an instance.
Auto Trait Implementations§
impl<'a> Freeze for Elaborator<'a>
impl<'a> !RefUnwindSafe for Elaborator<'a>
impl<'a> !Send for Elaborator<'a>
impl<'a> !Sync for Elaborator<'a>
impl<'a> Unpin for Elaborator<'a>
impl<'a> !UnwindSafe for Elaborator<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.