feat: suspend managed calls on generic awaitable operands

This commit is contained in:
2026-10-23 20:14:15 +08:00
parent b33d322690
commit 16816c38c7
9 changed files with 90 additions and 10 deletions
+4
View File
@@ -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"),