reda-lib 0.4.0

Liberty file library
Documentation
use reda_lib_macro::model;
use crate::model::LibCell;

#[model]
#[derive(Debug, Clone, Default)]
pub struct LibLibrary {
    pub name: String,
    pub cells: Vec<LibCell>,
}

impl LibLibrary {
    pub fn new<S: Into<String>>(name: S) -> Self {
        Self { 
            name: name.into(),
            ..Default::default()
        }
    }

    pub fn cell(&self, name: &str) -> Option<&LibCell> {
        self.cells.iter().find(|c| c.name == name)
    }
}