summaryrefslogtreecommitdiff
path: root/core/extensions.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-08-21 17:37:53 +0530
committerGitHub <noreply@github.com>2022-08-21 17:37:53 +0530
commit906aa78af33c8405a47d5446d2a6fb3348c275bb (patch)
treec444e42b6bdfe4bad35634925829a1b1d190fa75 /core/extensions.rs
parente39d4e3e7fb9815bf094e7321d1d73d00275831a (diff)
feat(ops): V8 Fast Calls (#15291)
Diffstat (limited to 'core/extensions.rs')
-rw-r--r--core/extensions.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/extensions.rs b/core/extensions.rs
index ce6957875..846770d1f 100644
--- a/core/extensions.rs
+++ b/core/extensions.rs
@@ -2,6 +2,7 @@
use crate::OpState;
use anyhow::Error;
use std::{cell::RefCell, rc::Rc, task::Context};
+use v8::fast_api::FastFunction;
pub type SourcePair = (&'static str, &'static str);
pub type OpFnRef = v8::FunctionCallback;
@@ -9,14 +10,14 @@ pub type OpMiddlewareFn = dyn Fn(OpDecl) -> OpDecl;
pub type OpStateFn = dyn Fn(&mut OpState) -> Result<(), Error>;
pub type OpEventLoopFn = dyn Fn(Rc<RefCell<OpState>>, &mut Context) -> bool;
-#[derive(Clone, Copy)]
pub struct OpDecl {
pub name: &'static str,
pub v8_fn_ptr: OpFnRef,
pub enabled: bool,
- pub is_async: bool, // TODO(@AaronO): enum sync/async/fast ?
+ pub is_async: bool,
pub is_unstable: bool,
pub is_v8: bool,
+ pub fast_fn: Option<Box<dyn FastFunction>>,
}
impl OpDecl {