mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 06:38:03 +08:00
Convert values to typed edges and flip the interpreted executor
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user