Struct gds::GdsLibrary
source · pub struct GdsLibrary {Show 13 fields
pub name: ArcStr,
pub version: i16,
pub dates: GdsDateTimes,
pub units: GdsUnits,
pub structs: Vec<GdsStruct>,
pub libdirsize: Unsupported,
pub srfname: Unsupported,
pub libsecur: Unsupported,
pub reflibs: Unsupported,
pub fonts: Unsupported,
pub attrtable: Unsupported,
pub generations: Unsupported,
pub format_type: Unsupported,
}
Expand description
A GDS library.
The Library is GDSII’s primary idiom for a suite of layout-cells.
A Library generally corresponds one-to-one with a .gds
file.
Libraries consist primarily of cell-definitions (GdsStructs),
and secondarily include library-level meta-data, including the distance units, GDS-spec version, and modification dates.
Several more esoteric library-level GDSII features are included as GdsLibrary fields, but are not materially supported. The empty Unsupported value generally denotes these fields.
Spec BNF:
HEADER BGNLIB [LIBDIRSIZE] [SRFNAME] [LIBSECUR] LIBNAME [REFLIBS] [FONTS] [ATTRTABLE] [GENERATIONS] [<FormatType>]
UNITS {<structure>}* ENDLIB
Fields§
§name: ArcStr
Library name.
version: i16
Gds spec version.
dates: GdsDateTimes
Modification date(s).
units: GdsUnits
Spatial units.
structs: Vec<GdsStruct>
Struct definitions.
libdirsize: Unsupported
§srfname: Unsupported
§libsecur: Unsupported
§reflibs: Unsupported
§fonts: Unsupported
§attrtable: Unsupported
§generations: Unsupported
§format_type: Unsupported
Implementations§
source§impl GdsLibrary
impl GdsLibrary
sourcepub fn new(name: impl Into<ArcStr>) -> Self
pub fn new(name: impl Into<ArcStr>) -> Self
Creates a new and empty GdsLibrary.
sourcepub fn with_units(name: impl Into<ArcStr>, units: GdsUnits) -> Self
pub fn with_units(name: impl Into<ArcStr>, units: GdsUnits) -> Self
Creates a new and empty GdsLibrary with the given units.
sourcepub fn load(fname: impl AsRef<Path>) -> GdsResult<GdsLibrary>
pub fn load(fname: impl AsRef<Path>) -> GdsResult<GdsLibrary>
Reads a GDS loaded from file at path fname
.
sourcepub fn from_bytes(bytes: Vec<u8>) -> GdsResult<GdsLibrary>
pub fn from_bytes(bytes: Vec<u8>) -> GdsResult<GdsLibrary>
Reads a GdsLibrary from byte-vector bytes
.
Trait Implementations§
source§impl Clone for GdsLibrary
impl Clone for GdsLibrary
source§fn clone(&self) -> GdsLibrary
fn clone(&self) -> GdsLibrary
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GdsLibrary
impl Debug for GdsLibrary
source§impl Default for GdsLibrary
impl Default for GdsLibrary
source§fn default() -> GdsLibrary
fn default() -> GdsLibrary
source§impl<'de> Deserialize<'de> for GdsLibrary
impl<'de> Deserialize<'de> for GdsLibrary
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>,
source§impl PartialEq for GdsLibrary
impl PartialEq for GdsLibrary
source§fn eq(&self, other: &GdsLibrary) -> bool
fn eq(&self, other: &GdsLibrary) -> bool
self
and other
values to be equal, and is used
by ==
.