Struct nannou::wgpu::BufferUsage [−]
#[repr(transparent)]pub struct BufferUsage { /* fields omitted */ }
Expand description
Different ways that you can use a buffer.
The usages determine what kind of memory the buffer is allocated from and what actions the buffer can partake in.
Implementations
impl BufferUsage
impl BufferUsage
pub const MAP_READ: BufferUsage
pub const MAP_READ: BufferUsage
Allow a buffer to be mapped for reading using [Buffer::map_async
] + [Buffer::get_mapped_range
].
This does not include creating a buffer with [BufferDescriptor::mapped_at_creation
] set.
If Features::MAPPABLE_PRIMARY_BUFFERS
isn’t enabled, the only other usage a buffer
may have is COPY_DST.
pub const MAP_WRITE: BufferUsage
pub const MAP_WRITE: BufferUsage
Allow a buffer to be mapped for writing using [Buffer::map_async
] + [Buffer::get_mapped_range_mut
].
This does not include creating a buffer with mapped_at_creation
set.
If Features::MAPPABLE_PRIMARY_BUFFERS
feature isn’t enabled, the only other usage a buffer
may have is COPY_SRC.
pub const COPY_SRC: BufferUsage
pub const COPY_SRC: BufferUsage
Allow a buffer to be the source buffer for a [CommandEncoder::copy_buffer_to_buffer
] or [CommandEncoder::copy_buffer_to_texture
]
operation.
pub const COPY_DST: BufferUsage
pub const COPY_DST: BufferUsage
Allow a buffer to be the destination buffer for a [CommandEncoder::copy_buffer_to_buffer
], [CommandEncoder::copy_texture_to_buffer
],
[CommandEncoder::fill_buffer
] or [Queue::write_buffer
] operation.
pub const INDEX: BufferUsage
pub const INDEX: BufferUsage
Allow a buffer to be the index buffer in a draw operation.
pub const VERTEX: BufferUsage
pub const VERTEX: BufferUsage
Allow a buffer to be the vertex buffer in a draw operation.
pub const UNIFORM: BufferUsage
pub const UNIFORM: BufferUsage
Allow a buffer to be a BufferBindingType::Uniform
inside a bind group.
pub const STORAGE: BufferUsage
pub const STORAGE: BufferUsage
Allow a buffer to be a BufferBindingType::Storage
inside a bind group.
pub const INDIRECT: BufferUsage
pub const INDIRECT: BufferUsage
Allow a buffer to be the indirect buffer in an indirect draw call.
pub const fn empty() -> BufferUsage
pub const fn empty() -> BufferUsage
Returns an empty set of flags
pub const fn all() -> BufferUsage
pub const fn all() -> BufferUsage
Returns the set containing all flags.
pub fn from_bits(bits: u32) -> Option<BufferUsage>
pub fn from_bits(bits: u32) -> Option<BufferUsage>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub const fn from_bits_truncate(bits: u32) -> BufferUsage
pub const fn from_bits_truncate(bits: u32) -> BufferUsage
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub const unsafe fn from_bits_unchecked(bits: u32) -> BufferUsage
pub const unsafe fn from_bits_unchecked(bits: u32) -> BufferUsage
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const fn intersects(&self, other: BufferUsage) -> bool
pub const fn intersects(&self, other: BufferUsage) -> bool
Returns true
if there are flags common to both self
and other
.
pub const fn contains(&self, other: BufferUsage) -> bool
pub const fn contains(&self, other: BufferUsage) -> bool
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: BufferUsage)
pub fn insert(&mut self, other: BufferUsage)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: BufferUsage)
pub fn remove(&mut self, other: BufferUsage)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: BufferUsage)
pub fn toggle(&mut self, other: BufferUsage)
Toggles the specified flags in-place.
pub fn set(&mut self, other: BufferUsage, value: bool)
pub fn set(&mut self, other: BufferUsage, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations
impl Binary for BufferUsage
impl Binary for BufferUsage
impl BitAnd<BufferUsage> for BufferUsage
impl BitAnd<BufferUsage> for BufferUsage
pub fn bitand(self, other: BufferUsage) -> BufferUsage
pub fn bitand(self, other: BufferUsage) -> BufferUsage
Returns the intersection between the two sets of flags.
type Output = BufferUsage
type Output = BufferUsage
The resulting type after applying the &
operator.
impl BitAndAssign<BufferUsage> for BufferUsage
impl BitAndAssign<BufferUsage> for BufferUsage
pub fn bitand_assign(&mut self, other: BufferUsage)
pub fn bitand_assign(&mut self, other: BufferUsage)
Disables all flags disabled in the set.
impl BitOr<BufferUsage> for BufferUsage
impl BitOr<BufferUsage> for BufferUsage
pub fn bitor(self, other: BufferUsage) -> BufferUsage
pub fn bitor(self, other: BufferUsage) -> BufferUsage
Returns the union of the two sets of flags.
type Output = BufferUsage
type Output = BufferUsage
The resulting type after applying the |
operator.
impl BitOrAssign<BufferUsage> for BufferUsage
impl BitOrAssign<BufferUsage> for BufferUsage
pub fn bitor_assign(&mut self, other: BufferUsage)
pub fn bitor_assign(&mut self, other: BufferUsage)
Adds the set of flags.
impl BitXor<BufferUsage> for BufferUsage
impl BitXor<BufferUsage> for BufferUsage
pub fn bitxor(self, other: BufferUsage) -> BufferUsage
pub fn bitxor(self, other: BufferUsage) -> BufferUsage
Returns the left flags, but with all the right flags toggled.
type Output = BufferUsage
type Output = BufferUsage
The resulting type after applying the ^
operator.
impl BitXorAssign<BufferUsage> for BufferUsage
impl BitXorAssign<BufferUsage> for BufferUsage
pub fn bitxor_assign(&mut self, other: BufferUsage)
pub fn bitxor_assign(&mut self, other: BufferUsage)
Toggles the set of flags.
impl Clone for BufferUsage
impl Clone for BufferUsage
pub fn clone(&self) -> BufferUsage
pub fn clone(&self) -> BufferUsage
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
impl Debug for BufferUsage
impl Debug for BufferUsage
impl Extend<BufferUsage> for BufferUsage
impl Extend<BufferUsage> for BufferUsage
pub fn extend<T>(&mut self, iterator: T) where
T: IntoIterator<Item = BufferUsage>,
pub fn extend<T>(&mut self, iterator: T) where
T: IntoIterator<Item = BufferUsage>,
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
impl FromIterator<BufferUsage> for BufferUsage
impl FromIterator<BufferUsage> for BufferUsage
pub fn from_iter<T>(iterator: T) -> BufferUsage where
T: IntoIterator<Item = BufferUsage>,
pub fn from_iter<T>(iterator: T) -> BufferUsage where
T: IntoIterator<Item = BufferUsage>,
Creates a value from an iterator. Read more
impl Hash for BufferUsage
impl Hash for BufferUsage
impl LowerHex for BufferUsage
impl LowerHex for BufferUsage
impl Not for BufferUsage
impl Not for BufferUsage
pub fn not(self) -> BufferUsage
pub fn not(self) -> BufferUsage
Returns the complement of this set of flags.
type Output = BufferUsage
type Output = BufferUsage
The resulting type after applying the !
operator.
impl Octal for BufferUsage
impl Octal for BufferUsage
impl Ord for BufferUsage
impl Ord for BufferUsage
pub fn cmp(&self, other: &BufferUsage) -> Ordering
pub fn cmp(&self, other: &BufferUsage) -> Ordering
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
impl PartialEq<BufferUsage> for BufferUsage
impl PartialEq<BufferUsage> for BufferUsage
pub fn eq(&self, other: &BufferUsage) -> bool
pub fn eq(&self, other: &BufferUsage) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &BufferUsage) -> bool
pub fn ne(&self, other: &BufferUsage) -> bool
This method tests for !=
.
impl PartialOrd<BufferUsage> for BufferUsage
impl PartialOrd<BufferUsage> for BufferUsage
pub fn partial_cmp(&self, other: &BufferUsage) -> Option<Ordering>
pub fn partial_cmp(&self, other: &BufferUsage) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
impl Sub<BufferUsage> for BufferUsage
impl Sub<BufferUsage> for BufferUsage
pub fn sub(self, other: BufferUsage) -> BufferUsage
pub fn sub(self, other: BufferUsage) -> BufferUsage
Returns the set difference of the two sets of flags.
type Output = BufferUsage
type Output = BufferUsage
The resulting type after applying the -
operator.
impl SubAssign<BufferUsage> for BufferUsage
impl SubAssign<BufferUsage> for BufferUsage
pub fn sub_assign(&mut self, other: BufferUsage)
pub fn sub_assign(&mut self, other: BufferUsage)
Disables all flags enabled in the set.
impl UpperHex for BufferUsage
impl UpperHex for BufferUsage
impl Copy for BufferUsage
impl Eq for BufferUsage
impl StructuralEq for BufferUsage
impl StructuralPartialEq for BufferUsage
Auto Trait Implementations
impl RefUnwindSafe for BufferUsage
impl Send for BufferUsage
impl Sync for BufferUsage
impl Unpin for BufferUsage
impl UnwindSafe for BufferUsage
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
Mutably borrows from an owned value. Read more
impl<T> CallHasher for T where
T: Hash,
impl<T> CallHasher for T where
T: Hash,
Convert into T with values clamped to the color defined bounds Read more
Convert into T. The resulting color might be invalid in its color space Read more
Convert into T, returning ok if the color is inside of its defined range,
otherwise an OutOfBounds
error is returned which contains the unclamped color. Read more
Compare self to key
and return true
if they are equal.
pub fn vzip(self) -> V