Skip to main content

FactAssembler

Struct FactAssembler 

Source
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

Source

pub fn new(format: FormatVersion) -> Self

Start an assembler for one canonical fact-format version.

Source

pub fn require_capability( &mut self, capability: CapabilityId, source: SourceSpan, ) -> Result<(), SchemaDiagnostics>

Add one required capability, retaining duplicate provenance.

Source

pub fn insert_fact( &mut self, fact: SchemaFact, source: SourceSpan, ) -> Result<(), SchemaDiagnostics>

Insert one fully identified direct fact.

Source

pub fn insert_struct( &mut self, fact: StructFact, source: SourceSpan, ) -> Result<(), SchemaDiagnostics>

Insert one struct declaration through the shared declaration namespace.

Source

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.

Source

pub fn insert_relates_with_collection_mode( &mut self, id: RelatesFactId, specializes: Option<(Label, SourceSpan)>, collection_mode: CollectionMode, source: SourceSpan, ) -> Result<(), SchemaDiagnostics>

Queue a related-role declaration with explicit collection semantics.

Source

pub fn insert_plays( &mut self, player: Label, relation: Label, role: Label, source: SourceSpan, )

Queue a player-keyed playing declaration for forward resolution.

Source

pub fn finish(self) -> Result<DeclaredSchema, SchemaDiagnostics>

Materialize deferred identities and construct the validated declared graph.

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> Same for T

Source§

type Output = T

Should always be Self
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.