Skip to main content

ContKind

Enum ContKind 

Source
pub enum ContKind {
    Pcall,
    Xpcall {
        handler: Value,
    },
    Meta(MetaCont),
    Pairs,
    Close(CloseCont),
}
Expand description

Continuation kind for yieldable native dispatch.

Variants§

§

Pcall

pcall(f, ...) — wraps the result as (true, ...) / (false, msg).

§

Xpcall

xpcall: the message handler to run if the protected call errors

Fields

§handler: Value

Message handler function invoked on error.

§

Meta(MetaCont)

a yieldable metamethod call triggered by a VM instruction (PUC’s luaV_finishOp): on the metamethod’s return the interrupted instruction is completed per MetaCont. A coroutine.yield inside the metamethod is preserved on the thread’s frame stack like any other call.

Tuple Fields

§0: MetaCont

Continuation describing how to finish the interrupted op.

§

Pairs

a yieldable __pairs metamethod call from pairs() (PUC luaB_pairs uses lua_callk): on return, its (≤4, nil-padded) results are pairs’s own results. A coroutine.yield inside __pairs is preserved like pcall’s.

§

Close(CloseCont)

a yieldable __close handler call driven by begin_close (PUC’s luaF_close + lua_callk continuation). On the handler’s return or error, the close iteration resumes from CloseCont’s state and either invokes the next handler (pushing a fresh Cont::Close) or executes the recorded AfterClose action.

Tuple Fields

§0: CloseCont

Per-iteration close state.

Trait Implementations§

Source§

impl Clone for ContKind

Source§

fn clone(&self) -> ContKind

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 ContKind

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, 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.