Skip to main content

web_sys/features/
gen_GpuBufferBinding.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBufferBinding)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuBufferBinding` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"]
13    #[doc = ""]
14    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type GpuBufferBinding;
17    #[cfg(web_sys_unstable_apis)]
18    #[cfg(feature = "GpuBuffer")]
19    #[doc = "Get the `buffer` field of this object."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"]
22    #[doc = ""]
23    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
25    #[wasm_bindgen(method, getter = "buffer")]
26    pub fn get_buffer(this: &GpuBufferBinding) -> GpuBuffer;
27    #[cfg(web_sys_unstable_apis)]
28    #[cfg(feature = "GpuBuffer")]
29    #[doc = "Change the `buffer` field of this object."]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"]
32    #[doc = ""]
33    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
35    #[wasm_bindgen(method, setter = "buffer")]
36    pub fn set_buffer(this: &GpuBufferBinding, val: &GpuBuffer);
37    #[cfg(web_sys_unstable_apis)]
38    #[doc = "Get the `offset` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"]
41    #[doc = ""]
42    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
43    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
44    #[wasm_bindgen(method, getter = "offset")]
45    pub fn get_offset(this: &GpuBufferBinding) -> Option<f64>;
46    #[cfg(web_sys_unstable_apis)]
47    #[doc = "Change the `offset` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"]
50    #[doc = ""]
51    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "offset")]
54    pub fn set_offset(this: &GpuBufferBinding, val: u32);
55    #[cfg(web_sys_unstable_apis)]
56    #[doc = "Change the `offset` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"]
59    #[doc = ""]
60    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
62    #[wasm_bindgen(method, setter = "offset")]
63    pub fn set_offset_f64(this: &GpuBufferBinding, val: f64);
64    #[cfg(web_sys_unstable_apis)]
65    #[doc = "Get the `size` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"]
68    #[doc = ""]
69    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
71    #[wasm_bindgen(method, getter = "size")]
72    pub fn get_size(this: &GpuBufferBinding) -> Option<f64>;
73    #[cfg(web_sys_unstable_apis)]
74    #[doc = "Change the `size` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"]
77    #[doc = ""]
78    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
79    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
80    #[wasm_bindgen(method, setter = "size")]
81    pub fn set_size(this: &GpuBufferBinding, val: u32);
82    #[cfg(web_sys_unstable_apis)]
83    #[doc = "Change the `size` field of this object."]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"]
86    #[doc = ""]
87    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
88    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
89    #[wasm_bindgen(method, setter = "size")]
90    pub fn set_size_f64(this: &GpuBufferBinding, val: f64);
91}
92#[cfg(web_sys_unstable_apis)]
93impl GpuBufferBinding {
94    #[cfg(feature = "GpuBuffer")]
95    #[doc = "Construct a new `GpuBufferBinding`."]
96    #[doc = ""]
97    #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"]
98    #[doc = ""]
99    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
100    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
101    pub fn new(buffer: &GpuBuffer) -> Self {
102        #[allow(unused_mut)]
103        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
104        ret.set_buffer(buffer);
105        ret
106    }
107    #[cfg(web_sys_unstable_apis)]
108    #[cfg(feature = "GpuBuffer")]
109    #[deprecated = "Use `set_buffer()` instead."]
110    pub fn buffer(&mut self, val: &GpuBuffer) -> &mut Self {
111        self.set_buffer(val);
112        self
113    }
114    #[cfg(web_sys_unstable_apis)]
115    #[deprecated = "Use `set_offset()` instead."]
116    pub fn offset(&mut self, val: u32) -> &mut Self {
117        self.set_offset(val);
118        self
119    }
120    #[cfg(web_sys_unstable_apis)]
121    #[deprecated = "Use `set_size()` instead."]
122    pub fn size(&mut self, val: u32) -> &mut Self {
123        self.set_size(val);
124        self
125    }
126}