Skip to main content

script_webcrypto/
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
9pub mod crypto;
10#[cfg(feature = "subtlecrypto")]
11pub mod cryptokey;
12#[cfg(feature = "subtlecrypto")]
13pub mod subtlecrypto;
14pub mod traits;
15
16pub(crate) use js::gc::Traceable as JSTraceable;
17pub(crate) use script_bindings::inheritance::HasParent;
18pub(crate) use script_bindings::reflector::{DomObject, MutDomObject, Reflector};
19
20// Reexports
21pub(crate) mod dom {
22    pub(crate) mod types {}
23    pub(crate) mod bindings {
24        pub(crate) use script_bindings::*;
25    }
26}
27
28/// Generated JS-Rust bindings.
29#[expect(non_snake_case)]
30pub(crate) mod codegen {
31    #[expect(unused)]
32    pub(crate) mod Bindings {
33        pub(crate) mod import {
34            pub(crate) use std::ptr;
35
36            pub(crate) use script_bindings::DomTypes;
37            pub(crate) use script_bindings::codegen::PrototypeList;
38            pub(crate) use script_bindings::conversions::IDLInterface;
39            pub(crate) use script_bindings::reflector::Reflector;
40            pub(crate) use script_bindings::utils::DOMClass;
41
42            pub(crate) use crate::traits::Equivalence;
43        }
44
45        pub(crate) mod CryptoBinding {
46            use crate::codegen::Bindings::import::*;
47            use crate::crypto::Crypto;
48            include!(concat!(
49                env!("OUT_DIR"),
50                "/ConcreteBindings/CryptoBinding.rs"
51            ));
52        }
53        #[cfg(feature = "subtlecrypto")]
54        pub(crate) mod CryptoKeyBinding {
55            use crate::codegen::Bindings::import::*;
56            use crate::cryptokey::CryptoKey;
57            include!(concat!(
58                env!("OUT_DIR"),
59                "/ConcreteBindings/CryptoKeyBinding.rs"
60            ));
61        }
62        #[cfg(feature = "subtlecrypto")]
63        pub(crate) mod SubtleCryptoBinding {
64            use crate::codegen::Bindings::import::*;
65            use crate::subtlecrypto::SubtleCrypto;
66            include!(concat!(
67                env!("OUT_DIR"),
68                "/ConcreteBindings/SubtleCryptoBinding.rs"
69            ));
70        }
71    }
72}