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
impl RunOutcome
Sourcepub fn parse(text: &str) -> Option<RunOutcome>
pub fn parse(text: &str) -> Option<RunOutcome>
Parses the name RunOutcome::as_str produces.
Sourcepub fn is_the_program_s_own(self) -> bool
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
impl Clone for RunOutcome
Source§fn clone(&self) -> RunOutcome
fn clone(&self) -> RunOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RunOutcome
Source§impl Debug for RunOutcome
impl Debug for RunOutcome
impl Eq for RunOutcome
Source§impl PartialEq for RunOutcome
impl PartialEq for RunOutcome
Source§fn eq(&self, other: &RunOutcome) -> bool
fn eq(&self, other: &RunOutcome) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RunOutcome
Auto Trait Implementations§
impl Freeze for RunOutcome
impl RefUnwindSafe for RunOutcome
impl Send for RunOutcome
impl Sync for RunOutcome
impl Unpin for RunOutcome
impl UnsafeUnpin for RunOutcome
impl UnwindSafe for RunOutcome
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.