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 callback;
19mod constant;
20mod constructor;
21pub mod conversions;
22pub mod error;
23mod finalize;
24mod guard;
25mod import;
26pub mod inheritance;
27pub mod interface;
28pub mod interfaces;
29pub mod iterable;
30pub mod like;
31mod lock;
32mod mem;
33mod namespace;
34pub mod num;
35pub mod principals;
36pub mod proxyhandler;
37pub mod realms;
38pub mod record;
39pub mod reflector;
40pub mod root;
41pub mod script_runtime;
42pub mod settings_stack;
43pub mod str;
44pub mod structuredclone;
45pub mod trace;
46pub mod utils;
47pub mod weakref;
48
49#[allow(non_snake_case, unsafe_op_in_unsafe_fn)]
50pub mod codegen {
51    pub mod Globals {
52        include!(concat!(env!("OUT_DIR"), "/Globals.rs"));
53    }
54    #[allow(dead_code, unused_imports, clippy::enum_variant_names)]
55    pub mod InheritTypes {
56        include!(concat!(env!("OUT_DIR"), "/InheritTypes.rs"));
57    }
58    #[allow(clippy::upper_case_acronyms)]
59    pub mod PrototypeList {
60        include!(concat!(env!("OUT_DIR"), "/PrototypeList.rs"));
61    }
62    pub(crate) mod DomTypes {
63        include!(concat!(env!("OUT_DIR"), "/DomTypes.rs"));
64    }
65    #[allow(
66        dead_code,
67        clippy::extra_unused_type_parameters,
68        clippy::missing_safety_doc,
69        clippy::result_unit_err
70    )]
71    pub mod GenericBindings {
72        include!(concat!(env!("OUT_DIR"), "/Bindings/mod.rs"));
73    }
74    #[allow(
75        non_camel_case_types,
76        unused_imports,
77        unused_variables,
78        clippy::large_enum_variant,
79        clippy::upper_case_acronyms,
80        clippy::enum_variant_names
81    )]
82    pub mod GenericUnionTypes {
83        include!(concat!(env!("OUT_DIR"), "/GenericUnionTypes.rs"));
84    }
85    pub mod RegisterBindings {
86        include!(concat!(env!("OUT_DIR"), "/RegisterBindings.rs"));
87    }
88}
89
90// These trait exports are public, because they are used in the DOM bindings.
91// Since they are used in derive macros,
92// it is useful that they are accessible at the root of the crate.
93pub(crate) use js::gc::Traceable as JSTraceable;
94
95pub use crate::codegen::DomTypes::DomTypes;
96pub(crate) use crate::reflector::{DomObject, MutDomObject, Reflector};
97pub(crate) use crate::trace::CustomTraceable;