mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
refactor(ops): remove variadic buffers (#9944)
This commit is contained in:
parent
adf5761090
commit
058579da56
49 changed files with 332 additions and 385 deletions
|
@ -7,7 +7,6 @@ use deno_core::error::AnyError;
|
|||
use deno_core::json_op_async;
|
||||
use deno_core::json_op_sync;
|
||||
use deno_core::serde_json::Value;
|
||||
use deno_core::BufVec;
|
||||
use deno_core::JsRuntime;
|
||||
use deno_core::OpState;
|
||||
use deno_core::ZeroCopyBuf;
|
||||
|
@ -18,7 +17,7 @@ use std::rc::Rc;
|
|||
|
||||
pub fn reg_json_async<F, R>(rt: &mut JsRuntime, name: &'static str, op_fn: F)
|
||||
where
|
||||
F: Fn(Rc<RefCell<OpState>>, Value, BufVec) -> R + 'static,
|
||||
F: Fn(Rc<RefCell<OpState>>, Value, Option<ZeroCopyBuf>) -> R + 'static,
|
||||
R: Future<Output = Result<Value, AnyError>> + 'static,
|
||||
{
|
||||
rt.register_op(name, metrics_op(name, json_op_async(op_fn)));
|
||||
|
@ -26,7 +25,7 @@ where
|
|||
|
||||
pub fn reg_json_sync<F>(rt: &mut JsRuntime, name: &'static str, op_fn: F)
|
||||
where
|
||||
F: Fn(&mut OpState, Value, &mut [ZeroCopyBuf]) -> Result<Value, AnyError>
|
||||
F: Fn(&mut OpState, Value, Option<ZeroCopyBuf>) -> Result<Value, AnyError>
|
||||
+ 'static,
|
||||
{
|
||||
rt.register_op(name, metrics_op(name, json_op_sync(op_fn)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue