use crate::*;
#[derive(Debug, Clone)]
pub struct QuerySet {
pub(crate) inner: dispatch::DispatchQuerySet,
}
#[cfg(send_sync)]
#[cfg(send_sync)]
static_assertions::assert_impl_all!(QuerySet: Send, Sync);
crate::cmp::impl_eq_ord_hash_proxy!(QuerySet => .inner);
impl QuerySet {
#[cfg(custom)]
pub fn as_custom<T: custom::QuerySetInterface>(&self) -> Option<&T> {
self.inner.as_custom()
}
pub fn destroy(&self) {
self.inner.destroy();
}
pub fn ty(&self) -> QueryType {
self.inner.ty()
}
pub fn count(&self) -> u32 {
self.inner.count()
}
}
#[cfg(wgpu_core)]
impl QuerySet {
pub fn from_core(core_query_set: alloc::sync::Arc<wgc::resource::QuerySet>) -> Self {
Self {
inner: crate::backend::wgpu_core::CoreQuerySet::from_core(core_query_set).into(),
}
}
pub fn as_core(&self) -> Option<alloc::sync::Arc<wgc::resource::QuerySet>> {
self.inner.as_core_opt().map(|qs| qs.as_core())
}
}
pub type QuerySetDescriptor<'a> = wgt::QuerySetDescriptor<Label<'a>>;
static_assertions::assert_impl_all!(QuerySetDescriptor<'_>: Send, Sync);