Skip to main content

Engine

Struct Engine 

Source
pub struct Engine<'catalog> { /* private fields */ }
Expand description

Pure engine facade backed by one validated catalog and revision.

Implementations§

Source§

impl Engine<'_>

Source

pub fn completion( &self, source: &str, document_version: u64, position: SourcePosition, ) -> OperationResult<CompletionOutput>

Computes context-aware completion from one complete UTF-8 source snapshot.

The response echoes document_version so a host can discard stale work. Core and caller-owned provider icons come from the same validated catalogs used by check and render operations.

Source

pub fn hover( &self, source: &str, document_version: u64, position: SourcePosition, ) -> OperationResult<HoverOutput>

Resolves plain-text semantic hover for one complete UTF-8 source snapshot.

The response echoes document_version so a host can discard stale work.

Source§

impl Engine<'static>

Source

pub fn bundled() -> Self

Creates an engine backed by the catalog embedded in stack-theme.

Source§

impl<'catalog> Engine<'catalog>

Source

pub fn with_provider_packs( provider_packs: &'catalog [ProviderPack], ) -> OperationResult<Self>

Creates an engine backed by the bundled catalog and validated provider packs.

Provider assets remain caller-owned in-memory data. The engine performs no discovery, file access, download, upload, caching, or terms decision.

Source

pub fn with_catalog( catalog: &'catalog Catalog, catalog_revision: &'catalog str, ) -> OperationResult<Self>

Creates an engine from a previously validated catalog and its content revision.

The catalog document must already have passed the public stack-theme schema and asset validator. This constructor checks the fallback records needed by every engine operation and rejects invalid execution input as an operational error rather than a user-source diagnostic.

Source

pub fn with_catalog_and_provider_packs( catalog: &'catalog Catalog, catalog_revision: &'catalog str, provider_packs: &'catalog [ProviderPack], ) -> OperationResult<Self>

Creates an engine from a validated catalog and validated provider packs.

Provider namespaces must be unique. Provider icons cannot replace core catalog identifiers because ProviderPack::new requires namespaced IDs.

Source

pub fn format(&self, source: &[u8]) -> OperationResult<FormatOutput>

Formats source while preserving compiler diagnostics in authored order.

Source

pub fn check(&self, source: &[u8]) -> OperationResult<CheckOutput>

Runs compiler, theme, layout, and routing validation without producing SVG.

Source

pub fn render(&self, source: &[u8]) -> OperationResult<RenderOutput>

Produces a deterministic standalone SVG from valid Stack source.

Invalid source returns a normal RenderOutput with ordered diagnostics and no SVG. Resource and layout warnings preserve a fallback SVG, while invalid catalog or intermediate pipeline state uses OperationalError.

Trait Implementations§

Source§

impl<'catalog> Clone for Engine<'catalog>

Source§

fn clone(&self) -> Engine<'catalog>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'catalog> Copy for Engine<'catalog>

Source§

impl<'catalog> Debug for Engine<'catalog>

Source§

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

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

impl Default for Engine<'static>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'catalog> Freeze for Engine<'catalog>

§

impl<'catalog> RefUnwindSafe for Engine<'catalog>

§

impl<'catalog> Send for Engine<'catalog>

§

impl<'catalog> Sync for Engine<'catalog>

§

impl<'catalog> Unpin for Engine<'catalog>

§

impl<'catalog> UnsafeUnpin for Engine<'catalog>

§

impl<'catalog> UnwindSafe for Engine<'catalog>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.