pub trait Resource<Id>: 'static + WasmNotSendSync
where Id: TypedId,
{ const TYPE: &'static str; // Required methods fn as_info(&self) -> &ResourceInfo<Id>; fn as_info_mut(&mut self) -> &mut ResourceInfo<Id>; // Provided methods fn label(&self) -> String { ... } fn ref_count(self: &Arc<Self>) -> usize { ... } fn is_unique(self: &Arc<Self>) -> bool { ... } fn is_equal(&self, other: &Self) -> bool { ... } }
Available on crate feature wgpu only.

Required Associated Constants§

const TYPE: &'static str

Required Methods§

fn as_info(&self) -> &ResourceInfo<Id>

fn as_info_mut(&mut self) -> &mut ResourceInfo<Id>

Provided Methods§

fn label(&self) -> String

fn ref_count(self: &Arc<Self>) -> usize

fn is_unique(self: &Arc<Self>) -> bool

fn is_equal(&self, other: &Self) -> bool

Object Safety§

This trait is not object safe.

Implementors§

§

impl Resource<Id<Surface>> for Surface

§

const TYPE: &'static str = "Surface"

§

impl<A> Resource<Id<BindGroup<Api>>> for BindGroup<A>
where A: HalApi,

§

const TYPE: &'static str = "BindGroup"

§

impl<A> Resource<Id<BindGroupLayout<Api>>> for BindGroupLayout<A>
where A: HalApi,

§

const TYPE: &'static str = "BindGroupLayout"

§

impl<A> Resource<Id<PipelineLayout<Api>>> for PipelineLayout<A>
where A: HalApi,

§

const TYPE: &'static str = "PipelineLayout"

§

impl<A> Resource<Id<CommandBuffer<Api>>> for CommandBuffer<A>
where A: HalApi,

§

const TYPE: &'static str = "CommandBuffer"

§

impl<A> Resource<Id<RenderBundle<Api>>> for RenderBundle<A>
where A: HalApi,

§

const TYPE: &'static str = "RenderBundle"

§

impl<A> Resource<Id<Device<Api>>> for Queue<A>
where A: HalApi,

§

const TYPE: &'static str = "Queue"

§

impl<A> Resource<Id<Device<Api>>> for Device<A>
where A: HalApi,

§

const TYPE: &'static str = "Device"

§

impl<A> Resource<Id<Adapter<Api>>> for Adapter<A>
where A: HalApi,

§

const TYPE: &'static str = "Adapter"

§

impl<A> Resource<Id<ComputePipeline<Api>>> for ComputePipeline<A>
where A: HalApi,

§

const TYPE: &'static str = "ComputePipeline"

§

impl<A> Resource<Id<RenderPipeline<Api>>> for RenderPipeline<A>
where A: HalApi,

§

const TYPE: &'static str = "RenderPipeline"

§

impl<A> Resource<Id<ShaderModule<Api>>> for ShaderModule<A>
where A: HalApi,

§

const TYPE: &'static str = "ShaderModule"

§

impl<A> Resource<Id<Buffer<Api>>> for Buffer<A>
where A: HalApi,

§

const TYPE: &'static str = "Buffer"

§

impl<A> Resource<Id<QuerySet<Api>>> for QuerySet<A>
where A: HalApi,

§

const TYPE: &'static str = "QuerySet"

§

impl<A> Resource<Id<Sampler<Api>>> for Sampler<A>
where A: HalApi,

§

const TYPE: &'static str = "Sampler"

§

impl<A> Resource<Id<StagingBuffer<Api>>> for StagingBuffer<A>
where A: HalApi,

§

const TYPE: &'static str = "StagingBuffer"

§

impl<A> Resource<Id<Texture<Api>>> for Texture<A>
where A: HalApi,

§

const TYPE: &'static str = "Texture"

§

impl<A> Resource<Id<TextureView<Api>>> for TextureView<A>
where A: HalApi,

§

const TYPE: &'static str = "TextureView"