Skip to main content

script_webgpu/
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 gpuadapter;
10pub mod gpuadapterinfo;
11pub mod gpubufferusage;
12pub mod gpucommandbuffer;
13pub mod gpucompilationinfo;
14pub mod gpucompilationmessage;
15pub mod gpudevicelostinfo;
16pub mod gpumapmode;
17pub mod gpurenderbundle;
18pub mod gpushaderstage;
19pub mod gpusupportedfeatures;
20pub mod gpusupportedlimits;
21pub mod gputextureusage;
22pub mod identityhub;
23pub mod promise;
24pub mod wgsllanguagefeatures;
25
26pub(crate) use js::gc::Traceable as JSTraceable;
27pub(crate) use jstraceable_derive::JSTraceable;
28pub(crate) use script_bindings::reflector::{DomObject, MutDomObject, Reflector};
29pub(crate) use script_bindings::trace::CustomTraceable;
30
31pub(crate) use crate::dom::bindings::inheritance::HasParent;
32
33// Reexports
34pub(crate) mod dom {
35    pub(crate) mod types {}
36    pub(crate) mod bindings {
37        pub(crate) use script_bindings::*;
38    }
39}
40
41/// Generated JS-Rust bindings.
42#[allow(missing_docs, non_snake_case)]
43pub(crate) mod codegen {
44    #[expect(unused)]
45    pub(crate) mod Bindings {
46        use std::ptr;
47
48        use js::context::JSContext;
49        use js::gc::HandleObject;
50        pub(crate) use script_bindings::DomTypes;
51        use script_bindings::conversions::IDLInterface;
52        use script_bindings::reflector::DomObjectWrap;
53        pub(crate) use script_bindings::reflector::Reflector;
54        use script_bindings::root::{Dom, DomRoot, Root};
55        use script_bindings::utils::DOMClass;
56
57        use crate::gpuadapter::GPUAdapter;
58        use crate::gpuadapterinfo::GPUAdapterInfo;
59        use crate::gpubufferusage::GPUBufferUsage;
60        use crate::gpucommandbuffer::GPUCommandBuffer;
61        use crate::gpucompilationinfo::GPUCompilationInfo;
62        use crate::gpucompilationmessage::GPUCompilationMessage;
63        use crate::gpudevicelostinfo::GPUDeviceLostInfo;
64        use crate::gpumapmode::GPUMapMode;
65        use crate::gpurenderbundle::GPURenderBundle;
66        use crate::gpushaderstage::GPUShaderStage;
67        use crate::gpusupportedfeatures::GPUSupportedFeatures;
68        use crate::gpusupportedlimits::GPUSupportedLimits;
69        use crate::gputextureusage::GPUTextureUsage;
70        use crate::wgsllanguagefeatures::WGSLLanguageFeatures;
71        include!(concat!(
72            env!("OUT_DIR"),
73            "/ConcreteBindings/WebGPUBinding.rs"
74        ));
75    }
76}