Struct scir::Cell

source ·
pub struct Cell { /* private fields */ }
Expand description

A cell.

Implementations§

source§

impl Cell

source

pub fn new(name: impl Into<ArcStr>) -> Self

Creates a new cell with the given name.

source

pub fn add_node(&mut self, name: impl Into<ArcStr>) -> SliceOne

Creates a new 1-bit signal in this cell.

source

pub fn add_bus(&mut self, name: impl Into<ArcStr>, width: usize) -> Slice

Creates a new 1-dimensional bus in this cell.

source

pub fn expose_port(&mut self, signal: impl Into<SignalId>, direction: Direction)

Exposes the given signal as a port.

If the signal is a bus, the entire bus is exposed. It is not possible to expose only a portion of a bus. Create two separate buses instead.

§Panics

Panics if the provided signal does not exist.

source

pub fn name(&self) -> &ArcStr

The name of the cell.

source

pub fn ports(&self) -> impl Iterator<Item = &Port>

Iterate over the ports of this cell.

source

pub fn port(&self, name: &str) -> &Port

Get a port of this cell by name.

§Panics

Panics if the provided port does not exist.

source

pub fn signals(&self) -> impl Iterator<Item = (SignalId, &SignalInfo)>

Iterate over the signals of this cell.

source

pub fn signal(&self, id: SignalId) -> &SignalInfo

Get the signal associated with the given ID.

§Panics

Panics if no signal with the given ID exists.

source

pub fn try_signal(&self, id: SignalId) -> Option<&SignalInfo>

Get the signal associated with the given ID.

source

pub fn signal_named(&self, name: &str) -> &SignalInfo

Get the signal associated with the given name.

§Panics

Panics if no signal with the given name exists.

source

pub fn try_signal_named(&self, name: &str) -> Option<&SignalInfo>

Get the signal associated with the given ID.

source

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.

source

pub fn try_instance(&self, id: InstanceId) -> Option<&Instance>

Get the instance associated with the given ID.

source

pub fn instance_named(&self, name: &str) -> &Instance

Gets the instance with the given name.

§Panics

Panics if no instance has the given name.

source

pub fn try_instance_named(&self, name: &str) -> Option<&Instance>

Gets the instance with the given name.

source

pub fn instance_from_path_element( &self, elem: &InstancePathElement ) -> &Instance

Gets the instance associated with the given path element.

source

pub fn add_instance(&mut self, instance: Instance) -> InstanceId

Add the given instance to the cell.

source

pub fn instances(&self) -> impl Iterator<Item = (InstanceId, &Instance)>

Iterate over the instances of this cell.

Trait Implementations§

source§

impl Clone for Cell

source§

fn clone(&self) -> Cell

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Cell

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Cell

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Cell

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Cell

§

impl Send for Cell

§

impl Sync for Cell

§

impl Unpin for Cell

§

impl UnwindSafe for Cell

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> Primitive for T