pub trait RenderResource {
type Data;
// Required methods
fn init(ctx: &WgpuContext, data: &Self::Data) -> Self;
fn update(&mut self, ctx: &WgpuContext, data: &Self::Data);
}Expand description
The RenderResource encapsules the wgpu resources.
It has a Data type that is used to initialize/update the resource.
Required Associated Types§
Sourcetype Data
type Data
The type used for RenderResource::init and RenderResource::update.
Required Methods§
Sourcefn init(ctx: &WgpuContext, data: &Self::Data) -> Self
fn init(ctx: &WgpuContext, data: &Self::Data) -> Self
Initialize a RenderResource using RenderResource::Data
Sourcefn update(&mut self, ctx: &WgpuContext, data: &Self::Data)
fn update(&mut self, ctx: &WgpuContext, data: &Self::Data)
update a RenderResource using RenderResource::Data
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.