Skip to main content

RanOutOfContentCause

Enum RanOutOfContentCause 

Source
pub enum RanOutOfContentCause {
    Tunnel,
    Function,
    Plain,
    Unknown,
}
Expand description

Why execution ran out of content — the call-stack shape C#’s Story.Continue() inspects to pick one of four messages (Story.cs, the AddError calls guarding the “ran out of content” branch: it checks callStack.CanPop(PushPopType.Tunnel), then .CanPop(PushPopType.Function), then !callStack.canPop, with a final backstop for none of the above).

Classified the moment a frame’s content is discovered exhausted (vm::handle_frame_exhaustion, the same instant C# reads callStack.CanPop), but only stashed on Flow — for the next continue_single call to raise as the deferred fault (issue #1574 ruled the deferred timing stays — this only changes which cause is attached, not when the fault fires) — on the paths where this exhaustion is itself the terminal one (vm::Stepped::Done). A frame whose exhaustion instead resumes execution (a completed thread with a parent to fall back to, a popped frame with content still below it) never writes its cause: otherwise a transient exhaustion elsewhere on the same flow (e.g. a Story::call_function boundary evaluating a function that calls a void helper) would clobber a cause an earlier, still-pending exhaustion had already recorded, and a later, unrelated Done would read it stale. It has to be classified that early rather than read fresh at fault time: unlike C#, this runtime’s own exhaustion recovery always pops the exhausted frame (even a Tunnel with nothing pending), so by the time the deferred fault fires the frame that triggered it is usually long gone from the call stack.

In practice, only Plain is reachable through any story today: a Tunnel or Function frame’s exhaustion classifies correctly at the instant it happens, but this runtime’s frame-popping (unlike C#’s) keeps unwinding past it instead of stopping there — cascading all the way to the root frame’s own exhaustion, which is the one that actually produces the terminal Done and gets its Plain cause stashed, before the fault ever surfaces. Making the other three arms reachable needs a separate, deliberate fix to that popping behavior — tracked in #2005.

Variants§

§

Tunnel

The top call-stack frame is a tunnel (->t->) — content ran out mid-tunnel with no ->-> to return. Mirrors callStack.CanPop(PushPopType.Tunnel).

§

Function

The top call-stack frame is a function call — content ran out mid-function with no ~ return. Mirrors callStack.CanPop(PushPopType.Function).

§

Plain

The call stack can’t pop at all (only the root frame remains) — the plain “story fell off the end” case, and the default when nothing more specific was ever recorded. Mirrors !callStack.canPop.

§

Unknown

The call stack can still pop, but the exhausted frame that produced the terminal Done is neither a tunnel nor a function — e.g. a Thread boundary with no parent thread left to fall back to, or a FunctionEvalFromGame boundary that is itself the last frame standing. C#’s backstop for a call-stack shape well-formed compiler output should never produce; an ordinary <- thread completing (a Thread frame exhausting with a parent thread still waiting) never reaches this arm — that path resumes via ThreadCompleted and records no cause at all.

Trait Implementations§

Source§

impl Clone for RanOutOfContentCause

Source§

fn clone(&self) -> RanOutOfContentCause

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 RanOutOfContentCause

Source§

impl Debug for RanOutOfContentCause

Source§

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

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

impl Default for RanOutOfContentCause

Source§

fn default() -> RanOutOfContentCause

Returns the “default value” for a type. Read more
Source§

impl Display for RanOutOfContentCause

Source§

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

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

impl Eq for RanOutOfContentCause

Source§

impl Error for RanOutOfContentCause

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for RanOutOfContentCause

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RanOutOfContentCause

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
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.