Skip to main content

RunOutcome

Enum RunOutcome 

Source
pub enum RunOutcome {
    Success,
    Error,
    Invariant,
    HostBoundary,
    Fuel,
    Deadline,
    Cancelled,
    CallDepth,
    HostCalls,
    Concurrency,
    Debugger,
}
Expand description

How a run ended.

Every run reaches exactly one of these, and TraceEvent::RunEnded records which. The names RunOutcome::as_str writes are a compatibility surface like the rest of the format: a reader groups runs by them.

The first two are the program answering. Cove’s entry returns Result<Unit, Error>, so a returned Err is a program saying what it was written to say and not a failure of the run — which is why it is kept apart from every other way a run can end. The rest are failures, and they divide the way crate::error::RuntimeError’s own documentation divides them: a broken invariant, the Host API boundary refusing, or a limit the host imposed. The limits are crate::budget::Stopped one for one, so a trace names the control that stopped the run rather than reporting six stops as one.

Variants§

§

Success

The entry returned a value that is not an Err.

§

Error

The entry returned Err(...): expected failure, expressed in the language rather than by stopping the run.

§

Invariant

Cove execution broke an invariant — a failed assertion, a division by zero, an overflow, a violated task-safety rule.

This is also where a host that failed on its own terms arrives, and the two are not currently told apart: an error raised inside a host and an error raised by a Cove callback the host was running come back out of the same call, and nothing at the boundary can say which was which.

§

HostBoundary

The Host API boundary refused: a capability the run was not granted, an operation that does not exist, or an argument or a result the operation’s own schema does not admit.

§

Fuel

The fuel budget was exhausted.

§

Deadline

The wall-clock deadline was exceeded.

§

Cancelled

The run was cancelled from outside.

§

CallDepth

The call-depth limit was exceeded.

§

HostCalls

The host-call limit was exceeded.

§

Concurrency

A spawn would have passed the concurrency limit.

§

Debugger

A debugger halted the run.

Its own outcome for the reason every other stop mode has one: a reader deciding what to do about a stopped run wants to know which control stopped it, and a run somebody was stepping through is not a run that broke an invariant or ran out of anything.

Implementations§

Source§

impl RunOutcome

Source

pub fn as_str(self) -> &'static str

The name this outcome is written under in a trace.

Source

pub fn parse(text: &str) -> Option<RunOutcome>

Parses the name RunOutcome::as_str produces.

Source

pub fn is_the_program_s_own(self) -> bool

Whether this outcome is one a program chose rather than one the runtime imposed.

The distinction the trace makes with it is what a redacted trace carries: the message of a run the program ended is a value the program built, which may hold anything the run read, while the message of a run the runtime stopped is the runtime’s own sentence about its own limit.

Trait Implementations§

Source§

impl Clone for RunOutcome

Source§

fn clone(&self) -> RunOutcome

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 Copy for RunOutcome

Source§

impl Debug for RunOutcome

Source§

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

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

impl Eq for RunOutcome

Source§

impl PartialEq for RunOutcome

Source§

fn eq(&self, other: &RunOutcome) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for RunOutcome

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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 = 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.