Skip to main content

ProcessModuleOutcome

Enum ProcessModuleOutcome 

Source
pub enum ProcessModuleOutcome {
    Ok {
        file: ProcessedFile,
        imports: Vec<String>,
    },
    MissingImports {
        file: ProcessedFile,
        imports: Vec<String>,
        missing: Vec<String>,
    },
    HeaderParseFailed {
        diagnostics: LeanElabFailure,
    },
    Unsupported,
}
Expand description

Outcome of crate::LeanSession::process_module_with_info_tree.

The Lean shim parses the header first (via Lean.Parser.parseHeader) and only runs IO.processCommands if the header parsed cleanly. Ok / MissingImports therefore both carry a populated ProcessedFile (its diagnostics field captures any elaboration failure of the body); HeaderParseFailed short-circuits with just the parser’s diagnostics.

Variants§

§

Ok

Header parsed; every parsed import is present in the session’s open env; the body was processed. imports lists the user-written modules (Lean’s auto-inserted Init is filtered out by the shim).

Fields

§file: ProcessedFile

Body projection. file.diagnostics still records any per-command elaboration errors the body produced.

§imports: Vec<String>

User-written imports from the file’s header.

§

MissingImports

Header parsed but some imports name modules the session’s open env does not have. The body was still processed against the available env — file is populated and the partial projection is useful diagnostic data. Callers typically surface missing as a warning.

Fields

§file: ProcessedFile

Body projection (partial if some declarations depended on the missing modules).

§imports: Vec<String>

User-written imports from the file’s header.

§missing: Vec<String>

Subset of imports not present in the session’s open env.

§

HeaderParseFailed

Lean.Parser.parseHeader reported error-severity messages. IO.processCommands was not invoked; only the header diagnostics are returned.

Fields

§diagnostics: LeanElabFailure

Header-parser diagnostics, with the same byte-budget semantics as crate::host::evidence::LeanKernelOutcome::Rejected.

§

Unsupported

The capability dylib does not export the lean_rs_host_process_module_with_info_tree shim. No FFI call was made.

Trait Implementations§

Source§

impl Debug for ProcessModuleOutcome

Source§

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

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

impl<'lean> TryFromLean<'lean> for ProcessModuleOutcome

Source§

fn try_from_lean(obj: Obj<'lean>) -> LeanResult<Self>

Decode obj into Self, returning a LeanError::Host with stage [HostStage::Conversion] if the object’s kind or payload is outside the type’s representable range. Read more

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more