summaryrefslogtreecommitdiff
path: root/ext/fetch/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fetch/lib.rs')
-rw-r--r--ext/fetch/lib.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs
index e1859e8e3..7a0c9b16f 100644
--- a/ext/fetch/lib.rs
+++ b/ext/fetch/lib.rs
@@ -9,8 +9,8 @@ use deno_core::futures::Future;
use deno_core::futures::Stream;
use deno_core::futures::StreamExt;
use deno_core::include_js_files;
-use deno_core::op_async;
-use deno_core::op_sync;
+use deno_core::op;
+
use deno_core::url::Url;
use deno_core::AsyncRefCell;
use deno_core::AsyncResult;
@@ -100,12 +100,9 @@ where
"26_fetch.js",
))
.ops(vec![
- ("op_fetch", op_sync(op_fetch::<FP>)),
- ("op_fetch_send", op_async(op_fetch_send)),
- (
- "op_fetch_custom_client",
- op_sync(op_fetch_custom_client::<FP>),
- ),
+ op_fetch::decl::<FP>(),
+ op_fetch_send::decl(),
+ op_fetch_custom_client::decl::<FP>(),
])
.state(move |state| {
state.put::<Options>(options.clone());
@@ -192,6 +189,7 @@ pub struct FetchReturn {
cancel_handle_rid: Option<ResourceId>,
}
+#[op]
pub fn op_fetch<FP>(
state: &mut OpState,
args: FetchArgs,
@@ -367,6 +365,7 @@ pub struct FetchResponse {
response_rid: ResourceId,
}
+#[op]
pub async fn op_fetch_send(
state: Rc<RefCell<OpState>>,
rid: ResourceId,
@@ -525,6 +524,7 @@ pub struct CreateHttpClientOptions {
private_key: Option<String>,
}
+#[op]
pub fn op_fetch_custom_client<FP>(
state: &mut OpState,
args: CreateHttpClientOptions,