librashader/librashader-runtime-wgpu/src/handle.rs

18 lines
294 B
Rust
Raw Normal View History

2024-02-06 17:45:31 +11:00
use std::ops::Deref;
pub enum Handle<'a, T> {
Borrowed(&'a T),
Owned(T),
}
impl<T> Deref for Handle<'_, T> {
type Target = T;
fn deref(&self) -> &Self::Target {
match self {
Handle::Borrowed(r) => &r,
Handle::Owned(r) => &r,
}
}
}