Convert values to typed edges and flip the interpreted executor

This commit is contained in:
Dennis Kobert
2026-07-30 09:54:19 +00:00
parent b74c64ebcd
commit 149a39faac
5 changed files with 253 additions and 71 deletions

View File

@@ -98,6 +98,18 @@ impl<'i, T: Clone + 'i, I> Node<'i, I> for ClonedNode<T> {
}
}
impl<T: Clone, Input> crate::gnode::GNode<Input> for ClonedNode<T> {
type Output = T;
fn eval(&self, _input: &Input) -> crate::gpoll::GPoll<T> {
crate::gpoll::GPoll::Final(self.0.clone())
}
}
pub fn value_edge<T: Clone + crate::WasmNotSend + crate::WasmNotSync + 'static>(value: T) -> crate::registry::EdgeHandle {
crate::registry::EdgeHandle::new(std::sync::Arc::new(ClonedNode(value)) as std::sync::Arc<crate::registry::ErasedGNode<T>>)
}
impl<T: Clone> ClonedNode<T> {
pub const fn new(value: T) -> ClonedNode<T> {
ClonedNode(value)