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