Skip to main content

script_bindings/
lib.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5#![cfg_attr(crown, feature(register_tool))]
6// Register the linter `crown`, which is the Servo-specific linter for the script crate.
7#![cfg_attr(crown, register_tool(crown))]
8
9#[macro_use]
10extern crate js;
11#[macro_use]
12extern crate jstraceable_derive;
13#[macro_use]
14extern crate log;
15#[macro_use]
16extern crate malloc_size_of_derive;
17
18pub mod assert;
19pub mod callback;
20pub mod cell;
21mod constant;
22mod constructor;
23pub mod conversions;
24pub mod domstring;
25pub mod error;
26mod finalize;
27mod guard;
28mod import;
29pub mod inheritance;
30pub mod interface;
31pub mod interfaces;
32pub mod iterable;
33pub mod like;
34mod lock;
35mod mem;
36mod namespace;
37pub mod num;
38pub mod principals;
39pub mod proxyhandler;
40pub mod realms;
41pub mod record;
42pub mod reflector;
43pub mod root;
44pub mod script_runtime;
45pub mod settings_stack;
46pub mod str;
47pub mod structuredclone;
48pub mod trace;
49pub mod utils;
50pub mod weakref;
51pub mod wrap;
52
53#[allow(non_snake_case, unsafe_op_in_unsafe_fn)]
54pub mod codegen {
55    pub mod Globals {
56        include!(concat!(env!("OUT_DIR"), "/Globals.rs"));
57    }
58    #[allow(unused_imports, clippy::enum_variant_names)]
59    pub mod InheritTypes {
60        include!(concat!(env!("OUT_DIR"), "/InheritTypes.rs"));
61    }
62    #[allow(clippy::upper_case_acronyms)]
63    pub mod PrototypeList {
64        include!(concat!(env!("OUT_DIR"), "/PrototypeList.rs"));
65    }
66    pub(crate) mod DomTypes {
67        include!(concat!(env!("OUT_DIR"), "/DomTypes.rs"));
68    }
69    #[allow(
70        clippy::extra_unused_type_parameters,
71        clippy::missing_safety_doc,
72        clippy::result_unit_err
73    )]
74    pub mod GenericBindings {
75        include!(concat!(env!("OUT_DIR"), "/Bindings/mod.rs"));
76    }
77    #[allow(
78        non_camel_case_types,
79        unused_imports,
80        unused_variables,
81        clippy::large_enum_variant,
82        clippy::upper_case_acronyms,
83        clippy::enum_variant_names
84    )]
85    pub mod GenericUnionTypes {
86        include!(concat!(env!("OUT_DIR"), "/GenericUnionTypes.rs"));
87    }
88    pub mod RegisterBindings {
89        include!(concat!(env!("OUT_DIR"), "/RegisterBindings.rs"));
90    }
91}
92
93// These trait exports are public, because they are used in the DOM bindings.
94// Since they are used in derive macros,
95// it is useful that they are accessible at the root of the crate.
96pub(crate) use js::gc::Traceable as JSTraceable;
97
98pub use crate::codegen::DomTypes::DomTypes;
99pub(crate) use crate::reflector::{DomObject, MutDomObject, Reflector};
100pub(crate) use crate::trace::CustomTraceable;