Skip to main content
← Back to kicad-monkey Rust Docs kicad-monkey Rust Crate API Reference

kicad_monkey_core/
document_metadata.rs

1//! Close-to-format document metadata shared by KiCad board and schematic files.
2
3use std::collections::BTreeMap;
4use std::ops::Range;
5
6/// A KiCad paper declaration.
7///
8/// Boards and schematics use the same scalar layout: a named size, optional
9/// custom width and height, and an optional `portrait` flag.
10#[derive(Clone, Debug, PartialEq)]
11pub struct KiCadPaper {
12    pub size: String,
13    pub width: Option<f64>,
14    pub height: Option<f64>,
15    pub portrait: bool,
16    pub source_range: Option<Range<usize>>,
17}
18
19/// A KiCad drawing-sheet title block shared by boards and schematics.
20#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
21#[serde(deny_unknown_fields)]
22pub struct KiCadTitleBlock {
23    pub title: String,
24    pub date: String,
25    pub revision: String,
26    pub company: String,
27    pub comments: BTreeMap<i64, String>,
28    pub source_range: Range<usize>,
29}