ResourceUses

Trait ResourceUses 

Source
pub(crate) trait ResourceUses:
    Debug
    + BitAnd<Output = Self>
    + BitOr<Output = Self>
    + PartialEq
    + Sized
    + Copy {
    type Selector: Debug;

    const EXCLUSIVE: Self;

    // Required methods
    fn bits(self) -> u32;
    fn any_exclusive(self) -> bool;

    // Provided method
    fn is_invalid(self) -> bool { ... }
}
Expand description

The uses that a resource or subresource can be in.

Required Associated Constants§

Source

const EXCLUSIVE: Self

All flags that are exclusive.

Required Associated Types§

Source

type Selector: Debug

The selector used by this resource.

Required Methods§

Source

fn bits(self) -> u32

Turn the resource into a pile of bits.

Source

fn any_exclusive(self) -> bool

Returns true if any of the uses are exclusive.

Provided Methods§

Source

fn is_invalid(self) -> bool

Returns true if the given states violates the usage scope rule of any(inclusive) XOR one(exclusive)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ResourceUses for BufferUses

Source§

const EXCLUSIVE: Self = Self::EXCLUSIVE

Source§

type Selector = ()

Source§

fn bits(self) -> u32

Source§

fn any_exclusive(self) -> bool

Source§

impl ResourceUses for TextureUses

Source§

const EXCLUSIVE: Self = Self::EXCLUSIVE

Source§

type Selector = TextureSelector

Source§

fn bits(self) -> u32

Source§

fn any_exclusive(self) -> bool

Source§

fn is_invalid(self) -> bool

Implementors§