Skip to content

Commit

Permalink
Merge pull request #21 from Wybxc/iter-wire
Browse files Browse the repository at this point in the history
  • Loading branch information
zakarumych authored Apr 18, 2024
2 parents 062da28 + 9287f8a commit 0106647
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,11 @@ impl<T> Snarl<T> {
}
}

/// Iterates over wires.
pub fn wires(&self) -> impl Iterator<Item = (OutPinId, InPinId)> + '_ {
self.wires.iter().map(|wire| (wire.out_pin, wire.in_pin))
}

/// Returns input pin of the node.
#[must_use]
pub fn in_pin(&self, pin: InPinId) -> InPin {
Expand Down

0 comments on commit 0106647

Please sign in to comment.