pub struct Cell<L> { /* private fields */ }
Implementations§
Source§impl<L> Cell<L>
impl<L> Cell<L>
pub fn new(name: impl Into<ArcStr>) -> Self
Sourcepub fn ports(&self) -> impl Iterator<Item = (&ArcStr, &Port<L>)>
pub fn ports(&self) -> impl Iterator<Item = (&ArcStr, &Port<L>)>
Iterate over the ports of this cell.
pub fn add_port(&mut self, name: impl Into<ArcStr>, port: Port<L>)
Sourcepub fn instance(&self, id: InstanceId) -> &Instance
pub fn instance(&self, id: InstanceId) -> &Instance
Get the instance associated with the given ID.
§Panics
Panics if no instance with the given ID exists.
Sourcepub fn try_instance(&self, id: InstanceId) -> Option<&Instance>
pub fn try_instance(&self, id: InstanceId) -> Option<&Instance>
Get the instance associated with the given ID.
Sourcepub fn instance_named(&self, name: &str) -> &Instance
pub fn instance_named(&self, name: &str) -> &Instance
Sourcepub fn try_instance_named(&self, name: &str) -> Option<&Instance>
pub fn try_instance_named(&self, name: &str) -> Option<&Instance>
Gets the instance with the given name.
Sourcepub fn add_instance(&mut self, instance: Instance) -> InstanceId
pub fn add_instance(&mut self, instance: Instance) -> InstanceId
Add the given instance to the cell.
Sourcepub fn instances(&self) -> impl Iterator<Item = (InstanceId, &Instance)>
pub fn instances(&self) -> impl Iterator<Item = (InstanceId, &Instance)>
Iterate over the instances of this cell.
pub fn add_element(&mut self, element: impl Into<Element<L>>)
pub fn elements(&self) -> impl Iterator<Item = &Element<L>>
Trait Implementations§
Source§impl<'de, L> Deserialize<'de> for Cell<L>where
L: Deserialize<'de>,
impl<'de, L> Deserialize<'de> for Cell<L>where
L: Deserialize<'de>,
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
impl<L: Eq> Eq for Cell<L>
impl<L> StructuralPartialEq for Cell<L>
Auto Trait Implementations§
impl<L> Freeze for Cell<L>
impl<L> RefUnwindSafe for Cell<L>where
L: RefUnwindSafe,
impl<L> Send for Cell<L>where
L: Send,
impl<L> Sync for Cell<L>where
L: Sync,
impl<L> Unpin for Cell<L>where
L: Unpin,
impl<L> UnwindSafe for Cell<L>where
L: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.