pub trait CalculateSizeFor {
    // Required method
    fn calculate_size_for(nr_of_el: u64) -> NonZeroU64;
}
Expand description

Trait implemented for WGSL runtime-sized arrays and WGSL structs containing runtime-sized arrays (non fixed-footprint types)

Required Methods§

source

fn calculate_size_for(nr_of_el: u64) -> NonZeroU64

Returns the size of Self assuming the (contained) runtime-sized array has nr_of_el elements

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> CalculateSizeFor for &T
where T: CalculateSizeFor + ?Sized,

source§

impl<T> CalculateSizeFor for &mut T
where T: CalculateSizeFor + ?Sized,

source§

impl<T> CalculateSizeFor for [T]
where [T]: ShaderType<ExtraMetadata = ArrayMetadata>,

source§

impl<T> CalculateSizeFor for Cell<T>
where T: Copy + CalculateSizeFor + ?Sized,

Implementors§

source§

impl CalculateSizeFor for GpuPointLightsStorage
where GpuPointLightsStorage: ShaderType<ExtraMetadata = StructMetadata<1>>, Vec<GpuPointLight>: CalculateSizeFor,

source§

impl<T> CalculateSizeFor for Cow<'_, T>
where T: ToOwned<Owned = T> + CalculateSizeFor + ?Sized,

source§

impl<T> CalculateSizeFor for Box<T>
where T: CalculateSizeFor + ?Sized,

source§

impl<T> CalculateSizeFor for LinkedList<T>
where LinkedList<T>: ShaderType<ExtraMetadata = ArrayMetadata>,

source§

impl<T> CalculateSizeFor for VecDeque<T>
where VecDeque<T>: ShaderType<ExtraMetadata = ArrayMetadata>,

source§

impl<T> CalculateSizeFor for Rc<T>
where T: CalculateSizeFor + ?Sized,

source§

impl<T> CalculateSizeFor for Arc<T>
where T: CalculateSizeFor + ?Sized,

source§

impl<T> CalculateSizeFor for Vec<T>
where Vec<T>: ShaderType<ExtraMetadata = ArrayMetadata>,