mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-25 23:44:06 +00:00

* Make manual_compositon non optional and rename to call_argument * Fix clippy warnings * Remove automatic composition compiler infrastructure * Implement document migration * Fix tests * Fix compilation on web * Fix doble number test * Remove extra parens * Cleanup * Update demo artwork * Remove last compose node mention * Remove last mention of manual composition
27 lines
892 B
Rust
27 lines
892 B
Rust
use dyn_any::StaticType;
|
|
pub use graph_craft::proto::{Any, NodeContainer, TypeErasedBox, TypeErasedNode};
|
|
use graph_craft::proto::{FutureAny, SharedNodeContainer};
|
|
use graphene_core::NodeIO;
|
|
use graphene_core::WasmNotSend;
|
|
pub use graphene_core::registry::{DowncastBothNode, DynAnyNode, FutureWrapperNode, PanicNode};
|
|
pub use graphene_core::{Node, generic, ops};
|
|
|
|
pub trait IntoTypeErasedNode<'n> {
|
|
fn into_type_erased(self) -> TypeErasedBox<'n>;
|
|
}
|
|
|
|
impl<'n, N: 'n> IntoTypeErasedNode<'n> for N
|
|
where
|
|
N: for<'i> NodeIO<'i, Any<'i>, Output = FutureAny<'i>> + Sync + WasmNotSend,
|
|
{
|
|
fn into_type_erased(self) -> TypeErasedBox<'n> {
|
|
Box::new(self)
|
|
}
|
|
}
|
|
|
|
pub fn input_node<O: StaticType>(n: SharedNodeContainer) -> DowncastBothNode<(), O> {
|
|
downcast_node(n)
|
|
}
|
|
pub fn downcast_node<I: StaticType, O: StaticType>(n: SharedNodeContainer) -> DowncastBothNode<I, O> {
|
|
DowncastBothNode::new(n)
|
|
}
|