Restructure node graph proxy architecture

This commit is contained in:
Dennis
2022-04-03 19:25:07 +02:00
committed by Keavon Chambers
parent cb337fd338
commit 90e465b35c
11 changed files with 128 additions and 81 deletions
+10 -1
View File
@@ -1,4 +1,4 @@
use graphene_core::Node;
use graphene_core::{Cache, Node};
use once_cell::sync::OnceCell;
/// Caches the output of a given Node and acts as a proxy
@@ -24,3 +24,12 @@ impl<'n, CachedNode: Node<'n, Input>, Input> CacheNode<'n, CachedNode, Input> {
}
}
}
impl<'n, CachedNode: Node<'n, Input>, Input> Cache for CacheNode<'n, CachedNode, Input> {
fn clear(&mut self) {
self.cache = OnceCell::new();
}
}
use dyn_any::{DynAny, StaticType};
#[derive(DynAny)]
struct Boo<'a>(&'a u8);