Migrate pass through and value node to identity implementation

This commit is contained in:
Adam
2025-07-06 13:23:24 -07:00
parent 007812077b
commit 7ecd1d0054
11 changed files with 83 additions and 68 deletions

View File

@@ -47,20 +47,19 @@ pub fn downcast_node<I: StaticType, O: StaticType>(n: SharedNodeContainer) -> Do
DowncastBothNode::new(n)
}
// Same idea as the identity node, but with a hidden primary input in order to have an auto generated properties widget for the value
pub struct Value {
pub struct IdentityNode {
value: SharedNodeContainer,
}
impl<'i> Node<'i, Any<'i>> for Value {
impl<'i> Node<'i, Any<'i>> for IdentityNode {
type Output = DynFuture<'i, Any<'i>>;
fn eval(&'i self, input: Any<'i>) -> Self::Output {
Box::pin(async move { self.value.eval(input).await })
}
}
impl Value {
impl IdentityNode {
pub const fn new(value: SharedNodeContainer) -> Self {
Value { value }
IdentityNode { value }
}
}