servo-script-bindings 0.4.0

A component of the servo web-engine.
Documentation
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */

pub(crate) mod base {
    pub(crate) use std::ptr;
    pub(crate) use std::rc::Rc;

    #[allow(unused_imports)]
    pub(crate) use js::context::{JSContext, NoGC, RawJSContext};
    pub(crate) use js::conversions::{
        ConversionBehavior, ConversionResult, FromJSValConvertible, ToJSValConvertible,
    };
    pub(crate) use js::error::throw_type_error;
    pub(crate) use js::gc::RootedVec;
    pub(crate) use js::jsapi::{
        HandleValue as RawHandleValue, HandleValueArray, Heap, IsCallable, JSObject, Value,
    };
    pub(crate) use js::jsval::{JSVal, NullValue, ObjectOrNullValue, ObjectValue, UndefinedValue};
    pub(crate) use js::panic::maybe_resume_unwind;
    #[allow(unused_imports)]
    pub(crate) use js::realm::{AutoRealm, CurrentRealm};
    pub(crate) use js::rust::wrappers2::{Call, JS_NewObject};
    pub(crate) use js::rust::{
        HandleObject, HandleValue, MutableHandle, MutableHandleObject, MutableHandleValue,
    };
    pub(crate) use js::typedarray;
    pub(crate) use js::typedarray::{
        HeapArrayBuffer, HeapArrayBufferView, HeapFloat32Array, HeapFloat64Array, HeapUint8Array,
        HeapUint8ClampedArray,
    };

    pub(crate) use crate::callback::{
        CallbackContainer, CallbackFunction, CallbackInterface, CallbackObject, ExceptionHandling,
        ThisReflector, call_setup, wrap_call_this_value,
    };
    pub(crate) use crate::codegen::DomTypes::DomTypes;
    pub(crate) use crate::codegen::GenericUnionTypes;
    pub(crate) use crate::conversions::{StringificationBehavior, root_from_handlevalue};
    pub(crate) use crate::error::Error::JSFailed;
    pub(crate) use crate::error::Fallible;
    pub(crate) use crate::interfaces::*;
    pub(crate) use crate::lock::ThreadUnsafeOnceLock;
    pub(crate) use crate::num::Finite;
    pub(crate) use crate::proxyhandler::{CrossOriginProperties, is_platform_object_same_origin};
    pub(crate) use crate::reflector::DomObject;
    pub(crate) use crate::root::DomRoot;
    pub(crate) use crate::str::{ByteString, DOMString, USVString};
    pub(crate) use crate::trace::RootedTraceableBox;
    pub(crate) use crate::utils::{get_dictionary_property, set_dictionary_property};
}

pub(crate) mod module {
    pub(crate) use std::cmp;
    pub(crate) use std::ptr::NonNull;

    pub(crate) use js::conversions::ToJSValConvertible;
    pub(crate) use js::glue::{
        CreateProxyHandler, GetProxyReservedSlot, JS_GetReservedSlot, ProxyTraps,
    };
    pub(crate) use js::jsapi::{
        __BindgenBitfieldUnit, CallArgs, GCContext, Handle as RawHandle, HandleId as RawHandleId,
        HandleObject as RawHandleObject, JS_SetReservedSlot, JSCLASS_FOREGROUND_FINALIZE,
        JSCLASS_RESERVED_SLOTS_SHIFT, JSClass, JSClassOps, JSFunctionSpec, JSJitGetterCallArgs,
        JSJitInfo, JSJitInfo__bindgen_ty_1, JSJitInfo__bindgen_ty_2, JSJitInfo__bindgen_ty_3,
        JSJitInfo_AliasSet, JSJitInfo_ArgType, JSJitInfo_OpType, JSJitMethodCallArgs,
        JSJitSetterCallArgs, JSNativeWrapper, JSPROP_ENUMERATE, JSPROP_PERMANENT, JSPROP_READONLY,
        JSPropertySpec, JSPropertySpec_Accessor, JSPropertySpec_AccessorsOrValue,
        JSPropertySpec_AccessorsOrValue_Accessors, JSPropertySpec_Kind, JSPropertySpec_Name,
        JSPropertySpec_ValueWrapper, JSPropertySpec_ValueWrapper__bindgen_ty_1,
        JSPropertySpec_ValueWrapper_Type, JSTracer, JSTypedMethodJitInfo, JSValueType,
        MutableHandle as RawMutableHandle, MutableHandleIdVector as RawMutableHandleIdVector,
        MutableHandleObject as RawMutableHandleObject, MutableHandleValue as RawMutableHandleValue,
        ObjectOpResult, PropertyDescriptor, SymbolCode, jsid,
    };
    pub(crate) use js::panic::wrap_panic;
    pub(crate) use js::rust::wrappers2::{
        Call, GetRealmFunctionPrototype, GetWellKnownSymbol, JS_CopyOwnPropertiesAndPrivateFields,
        JS_DefineProperty, JS_DefinePropertyById2, JS_ForwardGetPropertyTo, JS_GetProperty,
        JS_GetPropertyDescriptorById, JS_HasPropertyById, JS_NewObjectWithoutMetadata,
        JS_NewPlainObject, JS_SetImmutablePrototype, JS_SetProperty, JS_SetPrototype,
        RUST_SYMBOL_TO_JSID,
    };
    pub(crate) use js::rust::{CustomAutoRooterGuard, GCMethods, Handle, MutableHandle};
    pub(crate) use js::{
        JS_CALLEE, JSCLASS_GLOBAL_SLOT_COUNT, JSCLASS_IS_GLOBAL, JSCLASS_RESERVED_SLOTS_MASK,
        typedarray,
    };
    pub(crate) use servo_config::pref;

    pub(crate) use super::base::*;
    pub(crate) use crate::codegen::Globals::Globals;
    pub(crate) use crate::codegen::{PrototypeList, RegisterBindings};
    pub(crate) use crate::constant::{ConstantSpec, ConstantVal};
    pub(crate) use crate::constructor::{
        CallbackInit, InitType, InterfaceInit, NamespaceInit, call_default_constructor,
        create_callback_interface_objects, create_interface, create_namespace_interface_objects,
    };
    #[cfg(feature = "testbinding")]
    pub(crate) use crate::conversions::native_from_handlevalue;
    pub(crate) use crate::conversions::{
        StringificationBehavior, is_array_like, jsid_to_string, native_from_object_static,
    };
    pub(crate) use crate::error::{Error, ErrorResult};
    pub(crate) use crate::finalize::{
        finalize_common, finalize_global, finalize_weak_referenceable,
    };
    pub(crate) use crate::guard::{Condition, Guard};
    pub(crate) use crate::inheritance::Castable;
    pub(crate) use crate::interface::{
        ConstructorClassHook, InterfaceConstructorBehavior, NonCallbackInterfaceObjectClass,
        ProtoOrIfaceIndex, create_global_object, create_named_constructors,
        create_noncallback_interface_object, define_dom_interface, define_guarded_methods,
        define_guarded_properties, get_per_interface_object_handle, is_exposed_in,
    };
    pub(crate) use crate::iterable::{Iterable, IterableIterator, IteratorType};
    #[cfg(feature = "testbinding")]
    pub(crate) use crate::like::Maplike;
    pub(crate) use crate::like::Setlike;
    pub(crate) use crate::mem::malloc_size_of_including_raw_self;
    pub(crate) use crate::namespace::NamespaceObjectClass;
    pub(crate) use crate::proxyhandler::{get_expando_object, set_property_descriptor};
    #[cfg(feature = "testbinding")]
    pub(crate) use crate::root::{Dom, DomSlice};
    pub(crate) use crate::root::{MaybeUnreflectedDom, Root};
    pub(crate) use crate::script_runtime::CanGc;
    pub(crate) use crate::utils::{
        DOM_PROTO_UNFORGEABLE_HOLDER_SLOT, DOMClass, DOMJSClass, JSCLASS_DOM_GLOBAL,
        ProtoOrIfaceArray, call_policies, enumerate_global, enumerate_window, exception_to_promise,
        generic_getter, generic_method, generic_setter, generic_static_promise_method,
        get_array_index_from_id, get_property_on_prototype, has_property_on_prototype,
        may_resolve_global, may_resolve_window, resolve_global, resolve_window, trace_global,
    };
    pub(crate) use crate::{JSTraceable, proxyhandler};
}