Unified I/O

LayKit can load and save GDSII and OASIS through a single API, similar to using gdstk.read_gds / gdstk.read_oas with automatic format detection.

Canonical library (load_library)

load_library returns a Library normalized to GDSII structures internally, so topology, geometry, and boolean helpers work on any input:

#![allow(unused)]
fn main() {
use laykit::load_library;

let lib = load_library("layout.gds")?; // or .oas
println!("{} cells ({:?})", lib.cell_count(), lib.original_format());
for cell in lib.cells() {
    println!("  {}", cell.name);
}
lib.save("copy.oas")?;
}

Native representation (load)

Use load when you want the on-disk format without conversion:

#![allow(unused)]
fn main() {
use laykit::{load, LayoutFile};

let layout = load("chip.oas")?;
match layout {
    LayoutFile::Oasis(oas) => { /* ... */ }
    LayoutFile::Gdsii(gds) => { /* ... */ }
}
}

Options

Errors

Operations return LaykitError (UnknownFormat, Io, Parse) instead of opaque boxed errors.