diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-06-24 13:54:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-24 13:54:10 +0200 |
commit | 65d9bfb53361bfce6dc594c6a9df92c017dea6cb (patch) | |
tree | 63886c7225b52444165be3abd53c4e745ca77512 /core/lib.rs | |
parent | 8d6dbda90ec0593f3f6e10c6696e320bdff7daa9 (diff) |
refactor(ops): Adding op2 macro and implementing in a couple of places (#19534)
This is a new op system that will eventually replace `#[op]`.
Features
- More maintainable, generally less-coupled code
- More modern Rust proc-macro libraries
- Enforces correct `fast` labelling for fast ops, allowing for visual
scanning of fast ops
- Explicit marking of `#[string]`, `#[serde]` and `#[smi]` parameters.
This first version of op2 supports integer and Option<integer>
parameters only, and allows us to start working on converting ops and
adding features.
Diffstat (limited to 'core/lib.rs')
-rw-r--r-- | core/lib.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/lib.rs b/core/lib.rs index 1f069e661..9a960e93a 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -41,6 +41,7 @@ pub use url; pub use v8; pub use deno_ops::op; +pub use deno_ops::op2; pub use crate::async_cancel::CancelFuture; pub use crate::async_cancel::CancelHandle; @@ -130,6 +131,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::OpDecl; pub use super::ops::to_op_result; pub use super::ops::OpCtx; pub use super::ops::OpResult; @@ -139,10 +141,17 @@ pub mod _ops { pub use super::runtime::ops::map_async_op4; pub use super::runtime::ops::queue_async_op; pub use super::runtime::ops::queue_fast_async_op; + pub use super::runtime::ops::to_i32; + pub use super::runtime::ops::to_u32; pub use super::runtime::V8_WRAPPER_OBJECT_INDEX; pub use super::runtime::V8_WRAPPER_TYPE_INDEX; } +pub(crate) mod deno_core { + pub(crate) use crate::_ops; + pub(crate) use crate::v8; +} + // TODO(mmastrac): Temporary while we move code around pub mod snapshot_util { pub use crate::runtime::create_snapshot; |