mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 07:18:04 +08:00
Make the dynamic node graph execution asynchronous (#1218)
* Make node graph execution async Make node macro generate async node implementations Start propagating async through the node system Async checkpoint Make Any<'i> Send + Sync Determine node io type using panic node Fix types for raster_node macro Finish porting node registry? Fix lifetime errors Remove Send + Sync requirements and start making node construction async Async MVP Fix tests Clippy fix * Fix nodes * Simplify lifetims for node macro + make node macro more modular * Reenable more nodes * Fix pasting images * Remove http test from brush node * Fix output type for cache node * Fix types for let scope * Fix formatting
This commit is contained in:
committed by
Keavon Chambers
parent
5c7211cb30
commit
4bd9fbd073
@@ -22,7 +22,7 @@ pub struct AddParameterNode<Second> {
|
||||
second: Second,
|
||||
}
|
||||
|
||||
#[node_macro::node_fn(AddParameterNode)]
|
||||
#[node_macro::node_new(AddParameterNode)]
|
||||
fn add_parameter<U, T>(first: U, second: T) -> <U as Add<T>>::Output
|
||||
where
|
||||
U: Add<T>,
|
||||
@@ -30,6 +30,24 @@ where
|
||||
first + second
|
||||
}
|
||||
|
||||
#[automatically_derived]
|
||||
impl<'input, U: 'input, T: 'input, S0: 'input> Node<'input, U> for AddParameterNode<S0>
|
||||
where
|
||||
U: Add<T>,
|
||||
S0: Node<'input, (), Output = T>,
|
||||
{
|
||||
type Output = <U as Add<T>>::Output;
|
||||
#[inline]
|
||||
fn eval(&'input self, first: U) -> Self::Output {
|
||||
let second = self.second.eval(());
|
||||
{
|
||||
{
|
||||
first + second
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MulParameterNode<Second> {
|
||||
second: Second,
|
||||
}
|
||||
@@ -181,7 +199,7 @@ pub struct MapResultNode<I, E, Mn> {
|
||||
}
|
||||
|
||||
#[node_macro::node_fn(MapResultNode<_I, _E>)]
|
||||
fn flat_map<_I, _E, N>(input: Result<_I, _E>, node: &'any_input N) -> Result<<N as Node<'input, _I>>::Output, _E>
|
||||
fn flat_map<_I, _E, N>(input: Result<_I, _E>, node: &'input N) -> Result<<N as Node<'input, _I>>::Output, _E>
|
||||
where
|
||||
N: for<'a> Node<'a, _I>,
|
||||
{
|
||||
@@ -195,7 +213,7 @@ pub struct FlatMapResultNode<I, O, E, Mn> {
|
||||
}
|
||||
|
||||
#[node_macro::node_fn(FlatMapResultNode<_I, _O, _E>)]
|
||||
fn flat_map<_I, _O, _E, N>(input: Result<_I, _E>, node: &'any_input N) -> Result<_O, _E>
|
||||
fn flat_map<_I, _O, _E, N>(input: Result<_I, _E>, node: &'input N) -> Result<_O, _E>
|
||||
where
|
||||
N: for<'a> Node<'a, _I, Output = Result<_O, _E>>,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user