feat: suspend managed calls on generic awaitable operands
This commit is contained in:
@@ -4,6 +4,8 @@ use std::fmt;
|
||||
/// retained for embedders; defining it here avoids a dependency on the VM.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum VmError {
|
||||
AwaitFailed(String),
|
||||
AwaitCancelled,
|
||||
ForeignHandle,
|
||||
InvalidHandle,
|
||||
IdentityExhausted,
|
||||
@@ -49,6 +51,8 @@ pub enum VmError {
|
||||
impl fmt::Display for VmError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::AwaitFailed(message) => write!(f, "await failed: {message}"),
|
||||
Self::AwaitCancelled => f.write_str("await cancelled"),
|
||||
Self::ForeignHandle => f.write_str("handle belongs to another VM"),
|
||||
Self::InvalidHandle => f.write_str("handle does not identify a live object"),
|
||||
Self::IdentityExhausted => f.write_str("process-local VM identities exhausted"),
|
||||
|
||||
Reference in New Issue
Block a user