pub struct PolydatMatterBuilder<'a> { /* private fields */ }Expand description
Builder for PolydatMatter. Configure exactly one input form
(source, pre-parsed statements, or program), plus optional
metadata, then call Self::build.
Implementations§
Source§impl<'a> PolydatMatterBuilder<'a>
impl<'a> PolydatMatterBuilder<'a>
Sourcepub fn label(self, label: impl Into<String>) -> Self
pub fn label(self, label: impl Into<String>) -> Self
Diagnostic label for this matter. Surfaces in compile
errors and the __transient parent name during the
SubcontextBuilder dance.
Sourcepub fn source(self, body: impl Into<String>) -> Self
pub fn source(self, body: impl Into<String>) -> Self
Provide Polydat source as a string. Mutually exclusive with
Self::statements and Self::program.
Sourcepub fn statements(self, stmts: Vec<Statement>) -> Self
pub fn statements(self, stmts: Vec<Statement>) -> Self
Provide Polydat source as pre-parsed AST statements. Mutually
exclusive with Self::source and Self::program.
Use when the caller has already run the module parser
(e.g. when synthesising scope source from a structured
model and wanting to skip a string round-trip).
Sourcepub fn program(self, program: Arc<PolydatProgram>) -> Self
pub fn program(self, program: Arc<PolydatProgram>) -> Self
Provide a pre-compiled program. Mutually exclusive with
Self::source and Self::statements. Used for per-
fiber state forks, comprehension iteration, and other
call sites that hold a compiled program directly.
Sourcepub fn iter_bindings(self, bindings: &'a [(String, Value)]) -> Self
pub fn iter_bindings(self, bindings: &'a [(String, Value)]) -> Self
Iter-var bindings applied before the parent binds the child. Only meaningful for the program form.
Sourcepub fn result_bindings(self, src: impl Into<String>) -> Self
pub fn result_bindings(self, src: impl Into<String>) -> Self
SRD-66 result-binding source. Folded through
super::SubcontextBuilder::add_result_bindings at
finalize. Only meaningful for source / statements forms.
Sourcepub fn inherited_outputs(self, names: Vec<String>) -> Self
pub fn inherited_outputs(self, names: Vec<String>) -> Self
Names to pass through mark_inherited_outputs so the
scope tree can distinguish own exports from cascade-
inherited names. Source / statements forms only.
Sourcepub fn options(self, options: CompileOptions) -> Self
pub fn options(self, options: CompileOptions) -> Self
Compile-time knobs (lib paths, strict mode, required outputs, cursor limit). Source / statements forms only.
Sourcepub fn build(self) -> Result<PolydatMatter<'a>, String>
pub fn build(self) -> Result<PolydatMatter<'a>, String>
Validate and produce typed matter. Errors when zero or more than one input form is configured.
Trait Implementations§
Source§impl<'a> Default for PolydatMatterBuilder<'a>
impl<'a> Default for PolydatMatterBuilder<'a>
Source§fn default() -> PolydatMatterBuilder<'a>
fn default() -> PolydatMatterBuilder<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PolydatMatterBuilder<'a>
impl<'a> !UnwindSafe for PolydatMatterBuilder<'a>
impl<'a> Freeze for PolydatMatterBuilder<'a>
impl<'a> Send for PolydatMatterBuilder<'a>
impl<'a> Sync for PolydatMatterBuilder<'a>
impl<'a> Unpin for PolydatMatterBuilder<'a>
impl<'a> UnsafeUnpin for PolydatMatterBuilder<'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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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