Skip to main content

LeanKernelOutcome

Enum LeanKernelOutcome 

Source
#[non_exhaustive]
pub enum LeanKernelOutcome<'lean> { Checked(LeanEvidence<'lean>), Rejected(LeanElabFailure), Unavailable(LeanElabFailure), Unsupported(LeanElabFailure), }
Expand description

Outcome of crate::LeanSession::kernel_check.

Carries either a crate::LeanEvidence handle (on Checked) or a LeanElabFailure (on every other status) so callers can both branch on the typed status tag via Self::status and read the structured diagnostics in the failure cases.

#[non_exhaustive] so the variant set tracks future toolchain classification refinements without breaking exhaustive matches.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Checked(LeanEvidence<'lean>)

The kernel accepted the declaration.

§

Rejected(LeanElabFailure)

The declaration reached kernel checking and was refused. The failure carries the diagnostics the elaborator and kernel produced.

§

Unavailable(LeanElabFailure)

The capability could not produce evidence (typically a parse failure). The failure carries the diagnostics Lean produced before aborting.

§

Unsupported(LeanElabFailure)

The source did not name a supported kind of declaration. The failure carries any diagnostics Lean produced while classifying.

Implementations§

Source§

impl LeanKernelOutcome<'_>

Source

pub fn status(&self) -> EvidenceStatus

Project the variant tag without consuming the payload.

Useful when the caller only needs to branch on Checked vs. one of the failure tags before deciding whether to read the contained LeanElabFailure diagnostics.

Trait Implementations§

Source§

impl<'lean> Debug for LeanKernelOutcome<'lean>

Source§

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

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

impl<'lean> TryFromLean<'lean> for LeanKernelOutcome<'lean>

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§

§

impl<'lean> Freeze for LeanKernelOutcome<'lean>

§

impl<'lean> RefUnwindSafe for LeanKernelOutcome<'lean>

§

impl<'lean> !Send for LeanKernelOutcome<'lean>

§

impl<'lean> !Sync for LeanKernelOutcome<'lean>

§

impl<'lean> Unpin for LeanKernelOutcome<'lean>

§

impl<'lean> UnsafeUnpin for LeanKernelOutcome<'lean>

§

impl<'lean> UnwindSafe for LeanKernelOutcome<'lean>

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