1#![allow(clippy::missing_safety_doc)]
27
28#[macro_use]
29extern crate bitflags;
30extern crate temporal_capi;
31
32mod array_buffer;
33mod array_buffer_view;
34mod bigint;
35mod binding;
36mod context;
37pub use context::ContextOptions;
38pub mod cppgc;
39mod data;
40mod date;
41mod exception;
42mod external;
43mod external_references;
44pub mod fast_api;
45mod fixed_array;
46mod function;
47mod gc;
48mod get_property_names_args_builder;
49mod handle;
50pub mod icu;
51mod isolate;
52mod isolate_create_params;
53mod microtask;
54mod module;
55mod name;
56mod number;
57mod object;
58mod platform;
59mod primitive_array;
60mod primitives;
61mod private;
62mod promise;
63mod property_attribute;
64mod property_descriptor;
65mod property_filter;
66mod property_handler_flags;
67mod proxy;
68mod regexp;
69mod scope;
70mod script;
71mod script_or_module;
72mod shared_array_buffer;
73mod snapshot;
74mod string;
75mod support;
76mod symbol;
77mod template;
78mod typed_array;
79mod unbound_module_script;
80mod unbound_script;
81mod value;
82mod value_deserializer;
83mod value_serializer;
84mod wasm;
85
86pub mod inspector;
87pub mod json;
88pub mod script_compiler;
89#[allow(non_snake_case)]
92pub mod V8;
93
94pub use array_buffer::*;
95pub use data::*;
96pub use exception::*;
97pub use external_references::ExternalReference;
98pub use function::*;
99pub use gc::*;
100pub use get_property_names_args_builder::*;
101pub use handle::Eternal;
102pub use handle::Global;
103pub use handle::Handle;
104pub use handle::Local;
105pub use handle::SealedLocal;
106pub use handle::TracedReference;
107pub use handle::Weak;
108pub use isolate::GarbageCollectionType;
109pub use isolate::HeapSpaceStatistics;
110pub use isolate::HeapStatistics;
111pub use isolate::HostCreateShadowRealmContextCallback;
112pub use isolate::HostImportModuleDynamicallyCallback;
113pub use isolate::HostImportModuleWithPhaseDynamicallyCallback;
114pub use isolate::HostInitializeImportMetaObjectCallback;
115pub use isolate::Isolate;
116pub use isolate::IsolateHandle;
117pub use isolate::MemoryPressureLevel;
118pub use isolate::MessageCallback;
119pub use isolate::MessageErrorLevel;
120pub use isolate::MicrotasksPolicy;
121pub use isolate::ModuleImportPhase;
122pub use isolate::NearHeapLimitCallback;
123pub use isolate::OomDetails;
124pub use isolate::OomErrorCallback;
125pub use isolate::OwnedIsolate;
126pub use isolate::PromiseHook;
127pub use isolate::PromiseHookType;
128pub use isolate::PromiseRejectCallback;
129pub use isolate::RealIsolate;
130pub use isolate::TimeZoneDetection;
131pub use isolate::UseCounterCallback;
132pub use isolate::UseCounterFeature;
133pub use isolate::WasmAsyncSuccess;
134pub use isolate_create_params::CreateParams;
135pub use microtask::MicrotaskQueue;
136pub use module::*;
137pub use object::*;
138pub use platform::Platform;
139pub use platform::new_default_platform;
140pub use platform::new_single_threaded_default_platform;
141pub use platform::new_unprotected_default_platform;
142pub use primitives::*;
143pub use promise::{PromiseRejectEvent, PromiseRejectMessage, PromiseState};
144pub use property_attribute::*;
145pub use property_descriptor::*;
146pub use property_filter::*;
147pub use property_handler_flags::*;
148pub use regexp::RegExpCreationFlags;
149pub use scope::AllowJavascriptExecutionScope;
150pub use scope::CallbackScope;
152pub use scope::ContextScope;
153pub use scope::DisallowJavascriptExecutionScope;
154pub use scope::EscapableHandleScope;
155pub use scope::PinCallbackScope;
156pub use scope::PinScope;
157pub use scope::PinnedRef;
158pub use scope::ScopeStorage;
159pub use isolate::UnsafeRawIsolatePtr;
161pub use scope::HandleScope;
162pub use scope::OnFailure;
163pub use scope::TryCatch;
164pub use script::ScriptOrigin;
165pub use script_compiler::CachedData;
166pub use snapshot::FunctionCodeHandling;
167pub use snapshot::StartupData;
168pub use string::Encoding;
169pub use string::NewStringType;
170pub use string::OneByteConst;
171pub use string::ValueView;
172pub use string::ValueViewData;
173pub use string::WriteFlags;
174pub use string::WriteOptions;
175pub use support::SharedPtr;
176pub use support::SharedRef;
177pub use support::UniquePtr;
178pub use support::UniqueRef;
179pub use template::*;
180pub use value_deserializer::ValueDeserializer;
181pub use value_deserializer::ValueDeserializerHelper;
182pub use value_deserializer::ValueDeserializerImpl;
183pub use value_serializer::ValueSerializer;
184pub use value_serializer::ValueSerializerHelper;
185pub use value_serializer::ValueSerializerImpl;
186pub use wasm::CompiledWasmModule;
187pub use wasm::WasmStreaming;
188
189pub const MAJOR_VERSION: u32 = binding::v8__MAJOR_VERSION;
191pub const MINOR_VERSION: u32 = binding::v8__MINOR_VERSION;
193pub const BUILD_NUMBER: u32 = binding::v8__BUILD_NUMBER;
195pub const PATCH_LEVEL: u32 = binding::v8__PATCH_LEVEL;
197pub const VERSION_STRING: &str =
199 match binding::v8__VERSION_STRING.to_str() {
201 Ok(v) => v,
202 Err(_) => panic!("Unable to convert CStr to &str??"),
203 };
204
205pub use support::MapFnTo;
207
208pub const TYPED_ARRAY_MAX_SIZE_IN_HEAP: usize =
209 binding::v8__TYPED_ARRAY_MAX_SIZE_IN_HEAP as _;
210
211#[cfg(test)]
212#[allow(unused)]
213pub(crate) fn initialize_v8() {
214 use std::sync::Once;
215
216 static INIT: Once = Once::new();
217 INIT.call_once(|| {
218 V8::initialize_platform(new_default_platform(0, false).make_shared());
219 V8::initialize();
220 });
221}