Redesign iced_wgpu layering architecture
This commit is contained in:
parent
99a904112c
commit
b05e61f5c8
36 changed files with 2781 additions and 2048 deletions
|
|
@ -5,7 +5,7 @@ use std::sync::Arc;
|
|||
/// A piece of data that can be cached.
|
||||
pub trait Cached: Sized {
|
||||
/// The type of cache produced.
|
||||
type Cache;
|
||||
type Cache: Clone;
|
||||
|
||||
/// Loads the [`Cache`] into a proper instance.
|
||||
///
|
||||
|
|
@ -15,7 +15,7 @@ pub trait Cached: Sized {
|
|||
/// Caches this value, producing its corresponding [`Cache`].
|
||||
///
|
||||
/// [`Cache`]: Self::Cache
|
||||
fn cache(self) -> Self::Cache;
|
||||
fn cache(self, previous: Option<Self::Cache>) -> Self::Cache;
|
||||
}
|
||||
|
||||
impl<T> Cached for Primitive<T> {
|
||||
|
|
@ -27,7 +27,7 @@ impl<T> Cached for Primitive<T> {
|
|||
}
|
||||
}
|
||||
|
||||
fn cache(self) -> Arc<Self> {
|
||||
fn cache(self, _previous: Option<Arc<Self>>) -> Arc<Self> {
|
||||
Arc::new(self)
|
||||
}
|
||||
}
|
||||
|
|
@ -38,5 +38,5 @@ impl Cached for () {
|
|||
|
||||
fn load(_cache: &Self::Cache) -> Self {}
|
||||
|
||||
fn cache(self) -> Self::Cache {}
|
||||
fn cache(self, _previous: Option<Self::Cache>) -> Self::Cache {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue