pub struct Instance { /* private fields */ }
Expand description
An instance of a child cell placed inside a parent cell.
Implementations§
source§impl Instance
impl Instance
sourcepub fn new(name: impl Into<ArcStr>, child: impl Into<ChildId>) -> Self
pub fn new(name: impl Into<ArcStr>, child: impl Into<ChildId>) -> Self
Create an instance of the given cell with the given name.
sourcepub fn connect(&mut self, name: impl Into<ArcStr>, conn: impl Into<Concat>)
pub fn connect(&mut self, name: impl Into<ArcStr>, conn: impl Into<Concat>)
Connect the given port of the child cell to the given node in the parent cell.
sourcepub fn child(&self) -> ChildId
pub fn child(&self) -> ChildId
The ID of the child cell.
This instance represents an instantiation of the child cell in a parent cell.
sourcepub fn name(&self) -> &ArcStr
pub fn name(&self) -> &ArcStr
The name of this instance.
This is not necessarily the name of the child cell.
sourcepub fn connections(&self) -> &HashMap<ArcStr, Concat>
pub fn connections(&self) -> &HashMap<ArcStr, Concat>
Returns a reference to this instance’s connection map.
sourcepub fn connections_mut(&mut self) -> &mut HashMap<ArcStr, Concat>
pub fn connections_mut(&mut self) -> &mut HashMap<ArcStr, Concat>
Returns a mutable reference to this instance’s connection map.
sourcepub fn connection<'a>(&'a self, port: &str) -> &'a Concat
pub fn connection<'a>(&'a self, port: &str) -> &'a Concat
sourcepub fn map_connections(&mut self, map_fn: impl Fn(ArcStr) -> ArcStr)
pub fn map_connections(&mut self, map_fn: impl Fn(ArcStr) -> ArcStr)
Maps the connections to this instance to new port names.
Exhibits undefined behavior if two connections map to the same port name.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Instance
impl<'de> Deserialize<'de> for Instance
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Instance
impl Send for Instance
impl Sync for Instance
impl Unpin for Instance
impl UnwindSafe for Instance
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more