1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-11 10:07:54 -05:00
denoland-deno/serde_v8/lib.rs
Bartek Iwańczuk dda0f1c343
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.
2023-06-22 23:37:56 +02:00

32 lines
841 B
Rust

// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
mod de;
mod error;
mod keys;
mod magic;
mod payload;
mod ser;
mod serializable;
pub mod utils;
pub use de::from_v8;
pub use de::from_v8_cached;
pub use de::to_utf8;
pub use de::Deserializer;
pub use error::Error;
pub use error::Result;
pub use keys::KeyCache;
pub use magic::any_value::AnyValue;
pub use magic::bigint::BigInt;
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;
pub use magic::u16string::U16String;
pub use magic::ExternalPointer;
pub use magic::Global;
pub use magic::Value;
pub use ser::to_v8;
pub use ser::Serializer;
pub use serializable::Serializable;
pub use serializable::SerializablePkg;