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(dead_code, 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        dead_code,
68        clippy::extra_unused_type_parameters,
69        clippy::missing_safety_doc,
70        clippy::result_unit_err
71    )]
72    pub mod GenericBindings {
73        include!(concat!(env!("OUT_DIR"), "/Bindings/mod.rs"));
74    }
75    #[allow(
76        non_camel_case_types,
77        unused_imports,
78        unused_variables,
79        clippy::large_enum_variant,
80        clippy::upper_case_acronyms,
81        clippy::enum_variant_names
82    )]
83    pub mod GenericUnionTypes {
84        include!(concat!(env!("OUT_DIR"), "/GenericUnionTypes.rs"));
85    }
86    pub mod RegisterBindings {
87        include!(concat!(env!("OUT_DIR"), "/RegisterBindings.rs"));
88    }
89}
90
91// These trait exports are public, because they are used in the DOM bindings.
92// Since they are used in derive macros,
93// it is useful that they are accessible at the root of the crate.
94pub(crate) use js::gc::Traceable as JSTraceable;
95
96pub use crate::codegen::DomTypes::DomTypes;
97pub(crate) use crate::reflector::{DomObject, MutDomObject, Reflector};
98pub(crate) use crate::trace::CustomTraceable;