pub trait NetlistEdit: NetlistBase + HierarchyEdit {
// Required methods
fn create_pin(
&mut self,
cell: &Self::CellId,
name: Self::NameType,
direction: Direction,
) -> Self::PinId;
fn remove_pin(&mut self, id: &Self::PinId);
fn rename_pin(
&mut self,
pin: &Self::PinId,
new_name: Self::NameType,
) -> Self::NameType;
fn create_net(
&mut self,
parent: &Self::CellId,
name: Option<Self::NameType>,
) -> Self::NetId;
fn rename_net(
&mut self,
net_id: &Self::NetId,
new_name: Option<Self::NameType>,
) -> Option<Self::NameType>;
fn remove_net(&mut self, net: &Self::NetId);
fn connect_pin(
&mut self,
pin: &Self::PinId,
net: Option<Self::NetId>,
) -> Option<Self::NetId>;
fn connect_pin_instance(
&mut self,
pin: &Self::PinInstId,
net: Option<Self::NetId>,
) -> Option<Self::NetId>;
// Provided methods
fn disconnect_pin(&mut self, pin: &Self::PinId) -> Option<Self::NetId> { ... }
fn disconnect_pin_instance(
&mut self,
pin_instance: &Self::PinInstId,
) -> Option<Self::NetId> { ... }
}Expand description
Trait for netlists that support editing.
This includes:
- creation and removal of pins and nets
- connecting pins and pin instances to nets
- renaming nets
- renaming pins
More complex operations which can be build on top of the basic operations
are provided by the NetlistEditUtil trait.
Required Methods§
Sourcefn create_pin(
&mut self,
cell: &Self::CellId,
name: Self::NameType,
direction: Direction,
) -> Self::PinId
fn create_pin( &mut self, cell: &Self::CellId, name: Self::NameType, direction: Direction, ) -> Self::PinId
Create a new pin in this cell. Also adds the pin to all instances of the cell.
Sourcefn remove_pin(&mut self, id: &Self::PinId)
fn remove_pin(&mut self, id: &Self::PinId)
Remove the pin from this circuit and from all instances of this circuit.
Sourcefn rename_pin(
&mut self,
pin: &Self::PinId,
new_name: Self::NameType,
) -> Self::NameType
fn rename_pin( &mut self, pin: &Self::PinId, new_name: Self::NameType, ) -> Self::NameType
Sourcefn create_net(
&mut self,
parent: &Self::CellId,
name: Option<Self::NameType>,
) -> Self::NetId
fn create_net( &mut self, parent: &Self::CellId, name: Option<Self::NameType>, ) -> Self::NetId
Create a net net that lives in the parent circuit.
Sourcefn rename_net(
&mut self,
net_id: &Self::NetId,
new_name: Option<Self::NameType>,
) -> Option<Self::NameType>
fn rename_net( &mut self, net_id: &Self::NetId, new_name: Option<Self::NameType>, ) -> Option<Self::NameType>
Set a new name for the net. This might panic if the name already exists. Returns the old name.
Sourcefn remove_net(&mut self, net: &Self::NetId)
fn remove_net(&mut self, net: &Self::NetId)
Delete the net if it exists and disconnect all connected terminals.
Provided Methods§
Sourcefn disconnect_pin(&mut self, pin: &Self::PinId) -> Option<Self::NetId>
fn disconnect_pin(&mut self, pin: &Self::PinId) -> Option<Self::NetId>
Disconnect the pin from any connected net. Returns the old connected net, if any.
Sourcefn disconnect_pin_instance(
&mut self,
pin_instance: &Self::PinInstId,
) -> Option<Self::NetId>
fn disconnect_pin_instance( &mut self, pin_instance: &Self::PinInstId, ) -> Option<Self::NetId>
Disconnect the pin instance from any connected net. Returns the old connected net, if any.
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.