summaryrefslogtreecommitdiff
path: root/serde_v8/lib.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-06-22 23:37:56 +0200
committerGitHub <noreply@github.com>2023-06-22 23:37:56 +0200
commitdda0f1c343bfb3196ce6a7c7e8c2acccfd5c2e5b (patch)
tree10fc273a620949ccf63826363499f8f39056896d /serde_v8/lib.rs
parentb319fa7f4965af3d3d576ea528248a31c96a4053 (diff)
refactor(serde_v8): split ZeroCopyBuf into JsBuffer and ToJsBuffer (#19566)
`ZeroCopyBuf` was convenient to use, but sometimes it did hide details that some copies were necessary in certain cases. Also it made it way to easy for the caller to pass around and convert into different values. This commit splits `ZeroCopyBuf` into `JsBuffer` (an array buffer coming from V8) and `ToJsBuffer` (a Rust buffer that will be converted into a V8 array buffer). As a result some magical conversions were removed (they were never used) limiting the API surface and preparing for changes in #19534.
Diffstat (limited to 'serde_v8/lib.rs')
-rw-r--r--serde_v8/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/serde_v8/lib.rs b/serde_v8/lib.rs
index 26d95c67a..59c8fd41f 100644
--- a/serde_v8/lib.rs
+++ b/serde_v8/lib.rs
@@ -17,7 +17,8 @@ pub use error::Result;
pub use keys::KeyCache;
pub use magic::any_value::AnyValue;
pub use magic::bigint::BigInt;
-pub use magic::buffer::ZeroCopyBuf;
+pub use magic::buffer::JsBuffer;
+pub use magic::buffer::ToJsBuffer;
pub use magic::bytestring::ByteString;
pub use magic::detached_buffer::DetachedBuffer;
pub use magic::string_or_buffer::StringOrBuffer;