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