[−][src]Enum lucet_runtime_internals::instance::RunResult
The result of running or resuming an Instance
.
Variants
Returned(UntypedRetVal)
An instance returned with a value.
The actual type of the contained value depends on the return type of the guest function that was called. For guest functions with no return value, it is undefined behavior to do anything with this value.
Yielded(YieldedVal)
An instance yielded, potentially with a value.
This arises when a hostcall invokes one of the
Vmctx::yield_*()
family of methods. Depending on which
variant is used, the YieldedVal
may contain a value passed from the guest context to the
host.
An instance that has yielded may only be resumed (with or without a value to returned to the guest), reset, or dropped. Attempting to run an instance from a new entrypoint after it has yielded but without first resetting will result in an error.
Methods
impl RunResult
[src]
pub fn returned(self) -> Result<UntypedRetVal, Error>
[src]
Try to get a return value from a run result, returning Error::InstanceNotReturned
if the
instance instead yielded.
pub fn returned_ref(&self) -> Result<&UntypedRetVal, Error>
[src]
Try to get a reference to a return value from a run result, returning
Error::InstanceNotReturned
if the instance instead yielded.
pub fn is_returned(&self) -> bool
[src]
Returns true
if the instance returned a value.
pub fn expect_returned(self, msg: &str) -> UntypedRetVal
[src]
Unwraps a run result into a return value.
Panics
Panics if the instance instead yielded, with a panic message including the passed message.
pub fn unwrap_returned(self) -> UntypedRetVal
[src]
pub fn yielded(self) -> Result<YieldedVal, Error>
[src]
Try to get a yielded value from a run result, returning Error::InstanceNotYielded
if the
instance instead returned.
pub fn yielded_ref(&self) -> Result<&YieldedVal, Error>
[src]
Try to get a reference to a yielded value from a run result, returning
Error::InstanceNotYielded
if the instance instead returned.
pub fn is_yielded(&self) -> bool
[src]
Returns true
if the instance yielded.
pub fn expect_yielded(self, msg: &str) -> YieldedVal
[src]
Unwraps a run result into a yielded value.
Panics
Panics if the instance instead returned, with a panic message including the passed message.
pub fn unwrap_yielded(self) -> YieldedVal
[src]
Trait Implementations
Auto Trait Implementations
impl !Send for RunResult
impl !Sync for RunResult
impl Unpin for RunResult
impl !UnwindSafe for RunResult
impl !RefUnwindSafe for RunResult
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self