1#![no_std]
2#![doc = include_str!("../README.md")]
3#![expect(non_camel_case_types)]
4#![expect(non_snake_case)]
5#![expect(non_upper_case_globals)]
6
7include!("../generated/bindings.rs");
8include!("../generated/lib.rs");
9
10impl WGPUStringView {
11 pub fn from_bytes(bytes: &[u8]) -> Self {
12 WGPUStringView {
13 data: bytes.as_ptr().cast(),
14 length: bytes.len(),
15 }
16 }
17
18 pub fn as_bytes(&self) -> &[u8] {
19 unsafe {
20 core::slice::from_raw_parts(
21 self.data.cast(),
22 self.length)
23 }
24 }
25}
26
27pub const WGPU_TRUE: WGPUBool = 1;
29
30pub const WGPU_FALSE: WGPUBool = 0;
32
33pub const WGPU_ARRAY_LAYER_COUNT_UNDEFINED: u32 = u32::MAX;
35
36pub const WGPU_COPY_STRIDE_UNDEFINED: u32 = u32::MAX;
38
39pub const WGPU_DEPTH_CLEAR_VALUE_UNDEFINED: f32 = f32::NAN;
41
42pub const WGPU_DEPTH_SLICE_UNDEFINED: u32 = u32::MAX;
44
45pub const WGPU_LIMIT_U32_UNDEFINED: u32 = u32::MAX;
47
48pub const WGPU_LIMIT_U64_UNDEFINED: u64 = u64::MAX;
50
51pub const WGPU_MIP_LEVEL_COUNT_UNDEFINED: u32 = u32::MAX;
53
54pub const WGPU_QUERY_SET_INDEX_UNDEFINED: u32 = u32::MAX;
56
57pub const WGPU_STRLEN: usize = usize::MAX;
59
60pub const WGPU_WHOLE_MAP_SIZE: usize = usize::MAX;
62
63pub const WGPU_WHOLE_SIZE: u64 = u64::MAX;