Skip to main content

LeanMetaResponse

Enum LeanMetaResponse 

Source
#[non_exhaustive]
pub enum LeanMetaResponse<Resp> { Ok(Resp), Failed(LeanElabFailure), TimeoutOrHeartbeat(LeanElabFailure), Unsupported(LeanElabFailure), }
Expand description

Outcome of a bounded MetaM service call.

Carries either a typed Resp payload (on Ok) 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.
§

Ok(Resp)

The MetaM action returned a typed payload.

§

Failed(LeanElabFailure)

The MetaM action raised a non-resource-exhaustion exception. The failure carries one error-severity diagnostic.

§

TimeoutOrHeartbeat(LeanElabFailure)

The heartbeat ceiling tripped before the action finished. The failure carries the heartbeat-exhaustion message Lean produced.

§

Unsupported(LeanElabFailure)

The capability did not provide this service. Either the Lean shim returned unsupported or the dispatcher synthesised this branch when the service’s symbol was absent at capability load.

Implementations§

Source§

impl<Resp> LeanMetaResponse<Resp>

Source

pub fn status(&self) -> MetaCallStatus

Project the variant tag without inspecting the payload.

Source

pub const fn code(&self) -> Option<LeanDiagnosticCode>

Project to the stable LeanDiagnosticCode taxonomy.

Ok returns None — the response carries a typed payload, not a diagnostic. The three failure variants map to LeanDiagnosticCode::Elaboration (the failure carries a LeanElabFailure in every case except Unsupported, which projects to LeanDiagnosticCode::Unsupported).

Trait Implementations§

Source§

impl<Resp: Debug> Debug for LeanMetaResponse<Resp>

Source§

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

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

impl<'lean, Resp> TryFromLean<'lean> for LeanMetaResponse<Resp>
where Resp: TryFromLean<'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<Resp> Freeze for LeanMetaResponse<Resp>
where Resp: Freeze,

§

impl<Resp> RefUnwindSafe for LeanMetaResponse<Resp>
where Resp: RefUnwindSafe,

§

impl<Resp> Send for LeanMetaResponse<Resp>
where Resp: Send,

§

impl<Resp> Sync for LeanMetaResponse<Resp>
where Resp: Sync,

§

impl<Resp> Unpin for LeanMetaResponse<Resp>
where Resp: Unpin,

§

impl<Resp> UnsafeUnpin for LeanMetaResponse<Resp>
where Resp: UnsafeUnpin,

§

impl<Resp> UnwindSafe for LeanMetaResponse<Resp>
where Resp: UnwindSafe,

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