diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-03-14 23:14:15 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-14 18:44:15 +0100 |
commit | b4e42953e1d243f2eda20e5be6b845d60b7bf688 (patch) | |
tree | 10b3bfff165f9c04f9174c7c399d44b9b724c3b3 /ext/fetch/lib.rs | |
parent | 4e3ed37037a2aa1edeac260dc3463a81d9cf9b88 (diff) |
feat(core): codegen ops (#13861)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
Diffstat (limited to 'ext/fetch/lib.rs')
-rw-r--r-- | ext/fetch/lib.rs | 16 |
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, |