summaryrefslogtreecommitdiff
path: root/core/ops_builtin.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/ops_builtin.rs')
-rw-r--r--core/ops_builtin.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/core/ops_builtin.rs b/core/ops_builtin.rs
index 0c071a918..70f478acd 100644
--- a/core/ops_builtin.rs
+++ b/core/ops_builtin.rs
@@ -27,9 +27,12 @@ crate::extension!(
op_wasm_streaming_feed,
op_wasm_streaming_set_url,
op_void_sync,
+ op_error_async,
+ op_error_async_deferred,
op_void_async,
op_void_async_deferred,
op_add,
+ op_add_async,
// TODO(@AaronO): track IO metrics for builtin streams
op_read,
op_read_all,
@@ -96,12 +99,27 @@ fn op_add(a: i32, b: i32) -> i32 {
a + b
}
+#[op]
+pub async fn op_add_async(a: i32, b: i32) -> i32 {
+ a + b
+}
+
#[op(fast)]
pub fn op_void_sync() {}
#[op]
pub async fn op_void_async() {}
+#[op]
+pub async fn op_error_async() -> Result<(), Error> {
+ Err(Error::msg("error"))
+}
+
+#[op(deferred)]
+pub async fn op_error_async_deferred() -> Result<(), Error> {
+ Err(Error::msg("error"))
+}
+
#[op(deferred)]
pub async fn op_void_async_deferred() {}