pub trait NetworkEdit: Network {
// Required methods
fn create_primary_input(&mut self) -> Self::Signal;
fn create_primary_output(&mut self, signal: Self::Signal) -> Self::Signal;
fn substitute(&mut self, old: Self::Signal, new: Self::Signal);
fn create_node(&mut self, node: Self::Node) -> Self::NodeId;
fn foreach_node_mut(&mut self, f: impl Fn(&mut Self::Node));
}Expand description
Generic functions to manipulate a logic network.
Required Methods§
Sourcefn create_primary_input(&mut self) -> Self::Signal
fn create_primary_input(&mut self) -> Self::Signal
Create a new input into the network.
Sourcefn create_primary_output(&mut self, signal: Self::Signal) -> Self::Signal
fn create_primary_output(&mut self, signal: Self::Signal) -> Self::Signal
Create an output of the network.
Sourcefn substitute(&mut self, old: Self::Signal, new: Self::Signal)
fn substitute(&mut self, old: Self::Signal, new: Self::Signal)
Substitute the old signal with the new signal in all nodes.
Sourcefn create_node(&mut self, node: Self::Node) -> Self::NodeId
fn create_node(&mut self, node: Self::Node) -> Self::NodeId
Insert a new node into the network. Returns the ID of the new node. This function can also return IDs that already existed before. For example if there is already a node with the same inputs.
Sourcefn foreach_node_mut(&mut self, f: impl Fn(&mut Self::Node))
fn foreach_node_mut(&mut self, f: impl Fn(&mut Self::Node))
Visit all logic nodes as mutable references.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.