From b4e42953e1d243f2eda20e5be6b845d60b7bf688 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Mon, 14 Mar 2022 23:14:15 +0530 Subject: feat(core): codegen ops (#13861) Co-authored-by: Aaron O'Mullan --- ext/web/blob.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ext/web/blob.rs') diff --git a/ext/web/blob.rs b/ext/web/blob.rs index 37e93c853..ad7f6c582 100644 --- a/ext/web/blob.rs +++ b/ext/web/blob.rs @@ -1,5 +1,7 @@ use async_trait::async_trait; use deno_core::error::type_error; +use deno_core::op; + use deno_core::parking_lot::Mutex; use deno_core::url::Url; use deno_core::ZeroCopyBuf; @@ -157,6 +159,7 @@ impl BlobPart for SlicedBlobPart { } } +#[op] pub fn op_blob_create_part( state: &mut deno_core::OpState, data: ZeroCopyBuf, @@ -175,6 +178,7 @@ pub struct SliceOptions { len: usize, } +#[op] pub fn op_blob_slice_part( state: &mut deno_core::OpState, id: Uuid, @@ -200,6 +204,7 @@ pub fn op_blob_slice_part( Ok(id) } +#[op] pub async fn op_blob_read_part( state: Rc>, id: Uuid, @@ -215,6 +220,7 @@ pub async fn op_blob_read_part( Ok(ZeroCopyBuf::from(buf.to_vec())) } +#[op] pub fn op_blob_remove_part( state: &mut deno_core::OpState, id: Uuid, @@ -225,6 +231,7 @@ pub fn op_blob_remove_part( Ok(()) } +#[op] pub fn op_blob_create_object_url( state: &mut deno_core::OpState, media_type: String, @@ -250,6 +257,7 @@ pub fn op_blob_create_object_url( Ok(url.to_string()) } +#[op] pub fn op_blob_revoke_object_url( state: &mut deno_core::OpState, url: String, @@ -273,6 +281,7 @@ pub struct ReturnBlobPart { pub size: usize, } +#[op] pub fn op_blob_from_object_url( state: &mut deno_core::OpState, url: String, -- cgit v1.2.3