use reda_lib_macro::model;
use crate::model::LibPin;
#[model]
#[derive(Debug, PartialEq, Clone, Default)]
pub struct LibCell {
pub name: String,
pub pins: Vec<LibPin>,
}
impl LibCell {
pub fn new<S: Into<String>>(name: S) -> Self {
Self {
name: name.into(),
..Default::default()
}
}
pub fn pin(&self, name: &str) -> Option<&LibPin> {
self.pins.iter().find(|p| p.name == name)
}
}