pub trait SpirvType {
// Required method
fn min_nbyte(&self) -> Option<usize>;
// Provided methods
fn nbyte(&self) -> Option<usize> { ... }
fn is_sized(&self) -> bool { ... }
fn member_offset(&self, _member_index: usize) -> Option<usize> { ... }
fn access_ty(&self) -> Option<AccessType> { ... }
}Required Methods§
Sourcefn min_nbyte(&self) -> Option<usize>
fn min_nbyte(&self) -> Option<usize>
Minimum size of the type in bytes if it can be represented in-memory.
It’s the size of all static members and plus one element if it’s an array.
Same as wgpu::BindingType::Buffer::min_binding_size.
Provided Methods§
Sourcefn is_sized(&self) -> bool
fn is_sized(&self) -> bool
Returns true if the type is sized. A sized type can be represented in-memory. Otherwise the type can only be used as a descriptor resource.
Sourcefn member_offset(&self, _member_index: usize) -> Option<usize>
fn member_offset(&self, _member_index: usize) -> Option<usize>
Returns the offset of the i-th member in bytes if it’s a composite type.
Sourcefn access_ty(&self) -> Option<AccessType>
fn access_ty(&self) -> Option<AccessType>
Returns how the type can be accessed: ReadOnly, WriteOnly or
ReadWrite.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".