NetworkEdit

Trait NetworkEdit 

Source
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§

Source

fn create_primary_input(&mut self) -> Self::Signal

Create a new input into the network.

Source

fn create_primary_output(&mut self, signal: Self::Signal) -> Self::Signal

Create an output of the network.

Source

fn substitute(&mut self, old: Self::Signal, new: Self::Signal)

Substitute the old signal with the new signal in all nodes.

Source

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.

Source

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.

Implementations on Foreign Types§

Source§

impl<NE: NetworkEdit + ?Sized> NetworkEdit for &mut NE

Source§

fn create_primary_input(&mut self) -> Self::Signal

Source§

fn create_primary_output(&mut self, signal: Self::Signal) -> Self::Signal

Source§

fn substitute(&mut self, old: Self::Signal, new: Self::Signal)

Source§

fn create_node(&mut self, node: Self::Node) -> Self::NodeId

Source§

fn foreach_node_mut(&mut self, f: impl Fn(&mut Self::Node))

Implementors§