pub struct FpLibTableFile;Implementations§
Source§impl FpLibTableFile
impl FpLibTableFile
Sourcepub fn read<P: AsRef<Path>>(path: P) -> Result<FpLibTableDocument, Error>
pub fn read<P: AsRef<Path>>(path: P) -> Result<FpLibTableDocument, Error>
Examples found in repository?
examples/read_all.rs (line 27)
8fn main() -> Result<(), Box<dyn std::error::Error>> {
9 let base = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
10 .join("examples")
11 .join("data");
12
13 let pcb = PcbFile::read(base.join("sample.kicad_pcb"))?;
14 println!("pcb version: {:?}", pcb.ast().version);
15 println!("pcb unknown nodes: {}", pcb.ast().unknown_nodes.len());
16
17 let footprint = FootprintFile::read(base.join("sample.kicad_mod"))?;
18 println!("footprint version: {:?}", footprint.ast().version);
19
20 let schematic = SchematicFile::read(base.join("sample.kicad_sch"))?;
21 println!("schematic version: {:?}", schematic.ast().version);
22 println!(
23 "schematic unknown nodes: {}",
24 schematic.ast().unknown_nodes.len()
25 );
26
27 let table = FpLibTableFile::read(base.join("fp-lib-table"))?;
28 println!("fp libs: {}", table.ast().library_count);
29
30 let sym_table = SymLibTableFile::read(base.join("sym-lib-table"))?;
31 println!("sym libs: {}", sym_table.ast().library_count);
32
33 let dru = DesignRulesFile::read(base.join("sample.kicad_dru"))?;
34 println!("rules: {}", dru.ast().rule_count);
35 println!("rule constraints: {}", dru.ast().total_constraint_count);
36
37 let project = ProjectFile::read(base.join("sample.kicad_pro"))?;
38 println!("project meta version: {:?}", project.ast().meta_version);
39
40 let worksheet = WorksheetFile::read(base.join("sample.kicad_wks"))?;
41 println!("worksheet version: {:?}", worksheet.ast().version);
42 println!("worksheet tbtext count: {}", worksheet.ast().tbtext_count);
43
44 pcb.write_mode("/tmp/out.kicad_pcb", WriteMode::Lossless)?;
45 Ok(())
46}Auto Trait Implementations§
impl Freeze for FpLibTableFile
impl RefUnwindSafe for FpLibTableFile
impl Send for FpLibTableFile
impl Sync for FpLibTableFile
impl Unpin for FpLibTableFile
impl UnsafeUnpin for FpLibTableFile
impl UnwindSafe for FpLibTableFile
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