pub struct GdsLibrary {
pub version: i16,
pub create_date: GdsDateTime,
pub modify_date: GdsDateTime,
pub name: String,
pub usrunits_per_dbunit: f64,
pub meters_per_dbunit: f64,
pub reflibs: Option<[String; 2]>,
pub fonts: Option<[String; 4]>,
pub attrtable: Option<String>,
pub generations: Option<i16>,
pub format: Option<GdsFormat>,
pub structures: HashMap<String, Arc<RwLock<GdsStructure>>>,
}Fields§
§version: i16§create_date: GdsDateTime§modify_date: GdsDateTime§name: String§usrunits_per_dbunit: f64The size of a database unit in user units. 1 database unit = xx user unit default = 0.001
meters_per_dbunit: f64The size of a database unit in meters. 1 database unit = xx meter default = 1e-9
reflibs: Option<[String; 2]>§fonts: Option<[String; 4]>§attrtable: Option<String>§generations: Option<i16>§format: Option<GdsFormat>§structures: HashMap<String, Arc<RwLock<GdsStructure>>>Implementations§
Source§impl GdsLibrary
impl GdsLibrary
pub fn new(name: impl Into<String>) -> Self
pub fn with_version(&mut self, version: i16)
pub fn usrunits_per_dbunit(&mut self, value: f64)
pub fn meters_per_dbunit(&mut self, value: f64)
pub fn new_structure( &mut self, name: impl Into<String>, ) -> Arc<RwLock<GdsStructure>> ⓘ
pub fn add_structure(&mut self, structure: Arc<RwLock<GdsStructure>>)
pub fn dbuint_to_micro(&self, uint: i32) -> f64
pub fn micro_to_dbunit(&self, micro: f64) -> i32
pub fn structure_size(&self) -> usize
Source§impl GdsLibrary
impl GdsLibrary
Sourcepub fn load_file<P: AsRef<Path>>(path: P) -> GdsReadResult<Self>
pub fn load_file<P: AsRef<Path>>(path: P) -> GdsReadResult<Self>
Examples found in repository?
More examples
Additional examples can be found in:
Sourcepub fn save_gds_file<P: AsRef<Path>>(&self, path: P) -> GdsWriteResult<()>
pub fn save_gds_file<P: AsRef<Path>>(&self, path: P) -> GdsWriteResult<()>
Examples found in repository?
More examples
examples/combine_stdcell.rs (line 23)
3fn main_result() -> Result<(), Box<dyn std::error::Error>> {
4 let mut lib = GdsLibrary::load_file("./data/leafcell/bitcell.gds")?;
5 let sense_amp = GdsLibrary::load_file("./data/leafcell/sense_amp.gds")?;
6 let write_driver = GdsLibrary::load_file("./data/leafcell/write_driver.gds")?;
7 let column_tri_gate = GdsLibrary::load_file("./data/leafcell/column_tri_gate.gds")?;
8 let precharge = GdsLibrary::load_file("./data/leafcell/precharge.gds")?;
9
10 println!("{}", lib.meters_per_dbunit);
11 println!("{}", precharge.meters_per_dbunit);
12 println!("{}", sense_amp.meters_per_dbunit);
13 println!("{}", column_tri_gate.meters_per_dbunit);
14 println!("{}", write_driver.meters_per_dbunit);
15
16 lib.structures.insert("precharge".into(), precharge.structures.iter().nth(0).unwrap().1.clone());
17 lib.structures.insert("sense_amp".into(), sense_amp.structures.iter().nth(0).unwrap().1.clone());
18 lib.structures.insert("tri_gate".into(), column_tri_gate.structures.iter().nth(0).unwrap().1.clone());
19 lib.structures.insert("write_driver".into(), write_driver.structures.iter().nth(0).unwrap().1.clone());
20
21 println!("{}", lib.structures.len());
22
23 lib.save_gds_file("./data/leafcell/leafcell.gds")?;
24
25 let lib = GdsLibrary::load_file("./data/leafcell/leafcell.gds")?;
26 println!("{}", lib.structures.len());
27 println!("{}", lib.meters_per_dbunit);
28
29 Ok(())
30}Sourcepub fn save_text_file<P: AsRef<Path>>(&self, path: P) -> GdsWriteResult<()>
pub fn save_text_file<P: AsRef<Path>>(&self, path: P) -> GdsWriteResult<()>
pub fn read<R: Read + Seek>(reader: R) -> GdsReadResult<Self>
pub fn write_gds<W: Write>(&self, writer: W) -> GdsWriteResult<()>
pub fn write_text<W: Write>(&self, writer: W) -> GdsWriteResult<()>
Trait Implementations§
Source§impl Clone for GdsLibrary
impl Clone for GdsLibrary
Source§fn clone(&self) -> GdsLibrary
fn clone(&self) -> GdsLibrary
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GdsLibrary
impl RefUnwindSafe for GdsLibrary
impl Send for GdsLibrary
impl Sync for GdsLibrary
impl Unpin for GdsLibrary
impl UnsafeUnpin for GdsLibrary
impl UnwindSafe for GdsLibrary
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more