| 169 | pub use NodeVariant::*; |
| 170 | |
| 171 | pub trait NodeBehavior: core::fmt::Debug + core::any::Any { |
| 172 | fn set_time(&mut self, time: Timestamp) { |
| 173 | unimplemented!(); |
| 174 | } |
| 175 | fn get_time(&self) -> Timestamp { |
| 176 | unimplemented!(); |
| 177 | } |
| 178 | |
| 179 | fn create_ports(&self, r: &mut Region) { |
| 180 | } |
| 181 | |
| 182 | fn ports_callback(&mut self, inputs: Vec<PortIdx>, outputs: Vec<PortIdx>, r: &mut Region) { |
| 183 | } |
| 184 | |
| 185 | fn codegen(&self, token: &NodeOwner, inputs: Vec<PortIdx>, outputs: Vec<PortIdx>, r: &mut Region, ir: &mut IR, ops: &mut Assembler) { |
| 186 | unimplemented!(); |
| 187 | } |
| 188 | |
| 189 | |
| 190 | fn tag(&self) -> String; |
| 191 | |
| 192 | fn input_count(&self) -> usize { |
| 193 | unimplemented!(); |
| 194 | } |
| 195 | fn output_count(&self) -> usize { |
| 196 | unimplemented!(); |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | impl Node { |
| 201 | pub fn as_variant<'a, T>(&'a self, token: &'a NodeOwner) -> Option<&'a T> where T: 'static { |
nothing calls this directly
no outgoing calls
no test coverage detected