#![allow(dead_code)] use std::marker::PhantomData; use rs_taskflow::flow::{Flow, TaskHandle}; use rs_taskflow::task::{ExecutableTask, TaskInputHandle}; use rs_taskflow_derive::{ generate_connect_tasks_funcs, generate_get_task_output_funcs, generate_task_input_iface_traits, generate_task_output_iface_traits, }; generate_task_input_iface_traits!(TaskInput, set_input, 4); generate_task_output_iface_traits!(TaskOutput, get_output, 4); #[derive(Clone, Debug)] struct TestTask {} impl ExecutableTask for TestTask { fn exec(&mut self, _flow: &Flow) { unimplemented!(); } } impl TaskInput0 for TestTask { fn set_input_0(&mut self, _task_input: TaskInputHandle) { unimplemented!(); } } impl TaskInput1 for TestTask { fn set_input_1(&mut self, _task_input: TaskInputHandle) { unimplemented!(); } } impl TaskInput2 for TestTask { fn set_input_2(&mut self, _task_input: TaskInputHandle) { unimplemented!(); } } impl TaskInput3> for TestTask { fn set_input_3(&mut self, _task_input: TaskInputHandle>) { unimplemented!(); } } impl TaskOutput0 for TestTask { fn get_output_0(_task: &dyn ExecutableTask) -> Option<&i32> { unimplemented!(); } } impl TaskOutput1 for TestTask { fn get_output_1(_task: &dyn ExecutableTask) -> Option<&u32> { unimplemented!(); } } impl TaskOutput2 for TestTask { fn get_output_2(_task: &dyn ExecutableTask) -> Option<&String> { unimplemented!(); } } impl TaskOutput3> for TestTask { fn get_output_3(_task: &dyn ExecutableTask) -> Option<&Option> { unimplemented!(); } } struct TaskReadHandle(PhantomData); impl TaskReadHandle { fn borrow(&self) -> &dyn ExecutableTask { unimplemented!() } } struct FakeFlow; impl FakeFlow { fn connect, B: TaskInput0, T>( &mut self, _task1_handle: &TaskHandle, _task1_output: fn(&dyn ExecutableTask) -> Option<&T>, _task2_handle: &TaskHandle, _task2_input: fn(&mut B, TaskInputHandle), ) { unimplemented!() } fn get_task(&self, _task_handle: &TaskHandle) -> TaskReadHandle { unimplemented!() } generate_connect_tasks_funcs!(4); } struct FakeExecution { flow: FakeFlow, } impl FakeExecution { generate_get_task_output_funcs!(4); } #[test] fn works() { let _task = TestTask {}; let _flow = FakeFlow {}; let _execution = FakeExecution { flow: _flow }; }