MCPcopy Create free account
hub / github.com/chc4/lineiform / ports_callback

Method ports_callback

tangle/src/node.rs:325–337  ·  view source on GitHub ↗
(&mut self, inputs: Vec<PortIdx>, outputs: Vec<PortIdx>, r: &mut Region)

Source from the content-addressed store, hash-verified

323 }
324
325 fn ports_callback(&mut self, inputs: Vec<PortIdx>, outputs: Vec<PortIdx>, r: &mut Region) {
326 // set the block port as a state edge, of the block itself
327 let port = outputs[0];
328 let new_state = r.states.len();
329 r.states.push(State {
330 name: format!("bb{}", new_state),
331 variant: StateVariant::Block(NodeIdx::new(0)), // this gets filled in by Region::observe_state_edges
332 producers: vec![],
333 });
334
335 r.constrain(port, Storage::Immaterial(Some(new_state.try_into().unwrap())));
336 r.ports[port].set_variant(EdgeVariant::State);
337 }
338
339 fn codegen(&self, token: &NodeOwner, inputs: Vec<PortIdx>, outputs: Vec<PortIdx>, r: &mut Region, ir: &mut IR, ops: &mut Assembler) {
340 // block entries don't codegen to anything

Callers 1

create_portsMethod · 0.45

Calls 5

pushMethod · 0.80
constrainMethod · 0.80
set_variantMethod · 0.80
connect_portsMethod · 0.80
cloneMethod · 0.80

Tested by

no test coverage detected