#[non_exhaustive]pub enum CallbackHostResult {
Ok(String),
Err(String),
Suspend(String),
}Available on crate feature
unstable-internals only.Expand description
The result a callback handler sends back to the invoke host import.
Distinguishes a successful result and an ordinary error (both surface to Python as a value / exception and let execution continue) from a suspension, which causes the import to poison the store’s fuel and halt the guest synchronously.
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(String)
The callback succeeded; the JSON value is returned to Python.
Err(String)
The callback failed; the message is raised as an exception in Python.
Suspend(String)
The callback asked to suspend. The import poisons fuel to halt the guest; the string is the opaque reason recorded for the caller.
Trait Implementations§
Source§impl Clone for CallbackHostResult
impl Clone for CallbackHostResult
Auto Trait Implementations§
impl Forget for CallbackHostResult
impl Freeze for CallbackHostResult
impl Move for CallbackHostResult
impl RefUnwindSafe for CallbackHostResult
impl Send for CallbackHostResult
impl Sync for CallbackHostResult
impl Unpin for CallbackHostResult
impl UnsafeUnpin for CallbackHostResult
impl UnwindSafe for CallbackHostResult
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more