wgpu/api/
query_set.rs

1use crate::*;
2
3/// Handle to a query set.
4///
5/// It can be created with [`Device::create_query_set`].
6///
7/// Corresponds to [WebGPU `GPUQuerySet`](https://gpuweb.github.io/gpuweb/#queryset).
8#[derive(Debug, Clone)]
9pub struct QuerySet {
10    pub(crate) inner: dispatch::DispatchQuerySet,
11}
12#[cfg(send_sync)]
13#[cfg(send_sync)]
14static_assertions::assert_impl_all!(QuerySet: Send, Sync);
15
16crate::cmp::impl_eq_ord_hash_proxy!(QuerySet => .inner);
17
18impl QuerySet {
19    #[cfg(custom)]
20    /// Returns custom implementation of QuerySet (if custom backend and is internally T)
21    pub fn as_custom<T: custom::QuerySetInterface>(&self) -> Option<&T> {
22        self.inner.as_custom()
23    }
24}
25
26/// Describes a [`QuerySet`].
27///
28/// For use with [`Device::create_query_set`].
29///
30/// Corresponds to [WebGPU `GPUQuerySetDescriptor`](
31/// https://gpuweb.github.io/gpuweb/#dictdef-gpuquerysetdescriptor).
32pub type QuerySetDescriptor<'a> = wgt::QuerySetDescriptor<Label<'a>>;
33static_assertions::assert_impl_all!(QuerySetDescriptor<'_>: Send, Sync);