Trait wgpu_core::hub::IdentityHandler
source · pub trait IdentityHandler<I>: Debug {
type Input: Clone + Debug;
// Required methods
fn process(&self, id: Self::Input, backend: Backend) -> I;
fn free(&self, id: I);
}
Expand description
A type that can build true ids from proto-ids, and free true ids.
For some implementations, the true id is based on the proto-id. The caller is responsible for providing well-allocated proto-ids.
For other implementations, the proto-id carries no information
(it’s ()
, say), and this IdentityHandler
type takes care of
allocating a fresh true id.
See the module-level documentation for details.