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 domstring;
23pub mod error;
24mod finalize;
25mod guard;
26mod import;
27pub mod inheritance;
28pub mod interface;
29pub mod interfaces;
30pub mod iterable;
31pub mod like;
32mod lock;
33mod mem;
34mod namespace;
35pub mod num;
36pub mod principals;
37pub mod proxyhandler;
38pub mod realms;
39pub mod record;
40pub mod reflector;
41pub mod root;
42pub mod script_runtime;
43pub mod settings_stack;
44pub mod str;
45pub mod structuredclone;
46pub mod trace;
47pub mod utils;
48pub mod weakref;
49
50#[allow(non_snake_case, unsafe_op_in_unsafe_fn)]
51pub mod codegen {
52    pub mod Globals {
53        include!(concat!(env!("OUT_DIR"), "/Globals.rs"));
54    }
55    #[allow(unused_imports, clippy::enum_variant_names)]
56    pub mod InheritTypes {
57        include!(concat!(env!("OUT_DIR"), "/InheritTypes.rs"));
58    }
59    #[allow(clippy::upper_case_acronyms)]
60    pub mod PrototypeList {
61        include!(concat!(env!("OUT_DIR"), "/PrototypeList.rs"));
62    }
63    pub(crate) mod DomTypes {
64        include!(concat!(env!("OUT_DIR"), "/DomTypes.rs"));
65    }
66    #[allow(
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;