diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-06-29 10:23:14 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-29 10:23:14 -0600 |
commit | fbb69329343c9985c26181e6297e6556c46d381d (patch) | |
tree | ee428c94727bdfdf9040a4944bd66981b4cd07fb /core/lib.rs | |
parent | 98df69fd4cbe3687e2ff3519fbd6bff4e5f3101f (diff) |
refactor(ops): op2 support for generics (#19636)
Implementation of generics for `#[op2]`, along with some refactoring to
improve the ergonomics of ops with generics parameters:
- The ops have generics on the struct rather than the associated
methods, which allows us to trait-ify ops (impossible when they are on
the methods)
- The decl() method can become a trait-associated const field which
unlocks future optimizations
Callers of ops need to switch from:
`op_net_connect_tcp::call::<TestPermission>(conn_state, ip_addr)` to
`op_net_connect_tcp::<TestPermission>::call(conn_state, ip_addr)`.
Diffstat (limited to 'core/lib.rs')
-rw-r--r-- | core/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/lib.rs b/core/lib.rs index 250d7dead..30a14f3e4 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -132,6 +132,7 @@ pub fn v8_version() -> &'static str { pub mod _ops { pub use super::error::throw_type_error; pub use super::error_codes::get_error_code; + pub use super::extensions::Op; pub use super::extensions::OpDecl; pub use super::ops::to_op_result; pub use super::ops::OpCtx; |