pub struct FactAssembler { /* private fields */ }Expand description
Source-language-neutral construction of direct schema facts.
Parsers provide validated contract identities and source spans. The assembler owns duplicate detection and the forward-reference resolution needed to mint stable role and playing identities consistently across source languages.
Implementations§
Source§impl FactAssembler
impl FactAssembler
Sourcepub fn new(format: FormatVersion) -> Self
pub fn new(format: FormatVersion) -> Self
Start an assembler for one canonical fact-format version.
Sourcepub fn require_capability(
&mut self,
capability: CapabilityId,
source: SourceSpan,
) -> Result<(), SchemaDiagnostics>
pub fn require_capability( &mut self, capability: CapabilityId, source: SourceSpan, ) -> Result<(), SchemaDiagnostics>
Add one required capability, retaining duplicate provenance.
Sourcepub fn insert_fact(
&mut self,
fact: SchemaFact,
source: SourceSpan,
) -> Result<(), SchemaDiagnostics>
pub fn insert_fact( &mut self, fact: SchemaFact, source: SourceSpan, ) -> Result<(), SchemaDiagnostics>
Insert one fully identified direct fact.
Sourcepub fn insert_struct(
&mut self,
fact: StructFact,
source: SourceSpan,
) -> Result<(), SchemaDiagnostics>
pub fn insert_struct( &mut self, fact: StructFact, source: SourceSpan, ) -> Result<(), SchemaDiagnostics>
Insert one struct declaration through the shared declaration namespace.
Sourcepub fn insert_relates(
&mut self,
id: RelatesFactId,
specializes: Option<(Label, SourceSpan)>,
source: SourceSpan,
) -> Result<(), SchemaDiagnostics>
pub fn insert_relates( &mut self, id: RelatesFactId, specializes: Option<(Label, SourceSpan)>, source: SourceSpan, ) -> Result<(), SchemaDiagnostics>
Queue a related-role declaration whose specialization may target an ancestor.
Sourcepub fn insert_plays(
&mut self,
player: Label,
relation: Label,
role: Label,
source: SourceSpan,
)
pub fn insert_plays( &mut self, player: Label, relation: Label, role: Label, source: SourceSpan, )
Queue a player-keyed playing declaration for forward resolution.
Sourcepub fn finish(self) -> Result<DeclaredSchema, SchemaDiagnostics>
pub fn finish(self) -> Result<DeclaredSchema, SchemaDiagnostics>
Materialize deferred identities and construct the validated declared graph.
Auto Trait Implementations§
impl Freeze for FactAssembler
impl RefUnwindSafe for FactAssembler
impl Send for FactAssembler
impl Sync for FactAssembler
impl Unpin for FactAssembler
impl UnsafeUnpin for FactAssembler
impl UnwindSafe for FactAssembler
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
Mutably borrows from an owned value. Read more