pub(crate) trait Resource: 'static + Sized + WasmNotSendSync {
    type Marker: Marker;

    const TYPE: &'static str;

    // Required methods
    fn as_info(&self) -> &ResourceInfo<Self>;
    fn as_info_mut(&mut self) -> &mut ResourceInfo<Self>;

    // Provided methods
    fn label(&self) -> &str { ... }
    fn ref_count(self: &Arc<Self>) -> usize { ... }
    fn is_unique(self: &Arc<Self>) -> bool { ... }
    fn is_equal(self: &Arc<Self>, other: &Arc<Self>) -> bool { ... }
    fn error_ident(&self) -> ResourceErrorIdent { ... }
}

Required Associated Types§

Required Associated Constants§

source

const TYPE: &'static str

Required Methods§

source

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

source

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

Provided Methods§

source

fn label(&self) -> &str

Returns a string identifying this resource for logging and errors.

It may be a user-provided string or it may be a placeholder from wgpu.

It is non-empty unless the user-provided string was empty.

source

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

source

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

source

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

source

fn error_ident(&self) -> ResourceErrorIdent

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Resource for Surface

source§

const TYPE: &'static str = "Surface"

§

type Marker = Surface

source§

impl<A: HalApi> Resource for BindGroup<A>

source§

const TYPE: &'static str = "BindGroup"

§

type Marker = BindGroup

source§

impl<A: HalApi> Resource for BindGroupLayout<A>

source§

const TYPE: &'static str = "BindGroupLayout"

§

type Marker = BindGroupLayout

source§

impl<A: HalApi> Resource for PipelineLayout<A>

source§

const TYPE: &'static str = "PipelineLayout"

§

type Marker = PipelineLayout

source§

impl<A: HalApi> Resource for RenderBundle<A>

source§

const TYPE: &'static str = "RenderBundle"

§

type Marker = RenderBundle

source§

impl<A: HalApi> Resource for CommandBuffer<A>

source§

const TYPE: &'static str = "CommandBuffer"

§

type Marker = CommandBuffer

source§

impl<A: HalApi> Resource for Queue<A>

source§

const TYPE: &'static str = "Queue"

§

type Marker = Queue

source§

impl<A: HalApi> Resource for Device<A>

source§

const TYPE: &'static str = "Device"

§

type Marker = Device

source§

impl<A: HalApi> Resource for Adapter<A>

source§

const TYPE: &'static str = "Adapter"

§

type Marker = Adapter

source§

impl<A: HalApi> Resource for ComputePipeline<A>

source§

const TYPE: &'static str = "ComputePipeline"

§

type Marker = ComputePipeline

source§

impl<A: HalApi> Resource for PipelineCache<A>

source§

const TYPE: &'static str = "PipelineCache"

§

type Marker = PipelineCache

source§

impl<A: HalApi> Resource for RenderPipeline<A>

source§

const TYPE: &'static str = "RenderPipeline"

§

type Marker = RenderPipeline

source§

impl<A: HalApi> Resource for ShaderModule<A>

source§

const TYPE: &'static str = "ShaderModule"

§

type Marker = ShaderModule

source§

impl<A: HalApi> Resource for Buffer<A>

source§

const TYPE: &'static str = "Buffer"

§

type Marker = Buffer

source§

impl<A: HalApi> Resource for QuerySet<A>

source§

const TYPE: &'static str = "QuerySet"

§

type Marker = QuerySet

source§

impl<A: HalApi> Resource for Sampler<A>

source§

const TYPE: &'static str = "Sampler"

§

type Marker = Sampler

source§

impl<A: HalApi> Resource for StagingBuffer<A>

source§

const TYPE: &'static str = "StagingBuffer"

§

type Marker = StagingBuffer

source§

impl<A: HalApi> Resource for Texture<A>

source§

const TYPE: &'static str = "Texture"

§

type Marker = Texture

source§

impl<A: HalApi> Resource for TextureView<A>

source§

const TYPE: &'static str = "TextureView"

§

type Marker = TextureView