pub struct PcbView<'a> { /* private fields */ }Expand description
A board view backed by one source buffer and exact selected form spans.
Implementations§
Source§impl<'a> PcbView<'a>
impl<'a> PcbView<'a>
Sourcepub fn paper(&self) -> Result<KiCadPaper, Error>
pub fn paper(&self) -> Result<KiCadPaper, Error>
Return the board paper declaration, or KiCad Monkey’s Python-compatible A4 default when the form is absent.
Sourcepub fn title_block(&self) -> Result<Option<KiCadTitleBlock>, Error>
pub fn title_block(&self) -> Result<Option<KiCadTitleBlock>, Error>
Decode the first board title block using the same close-to-format record that the schematic reader will consume.
Sourcepub fn declared_board_thickness(&self) -> Result<Option<f64>, Error>
pub fn declared_board_thickness(&self) -> Result<Option<f64>, Error>
Exact authored nominal board thickness, without the effective metadata default.
pub fn metadata(&self) -> Result<PcbBoardMetadata, Error>
pub fn variants( &self, ) -> impl Iterator<Item = Result<PcbBoardVariant, Error>> + '_
pub fn images(&self) -> impl Iterator<Item = Result<PcbImage, Error>> + '_
pub fn barcodes(&self) -> impl Iterator<Item = Result<PcbBarcode, Error>> + '_
pub fn tables(&self) -> impl Iterator<Item = Result<PcbTable, Error>> + '_
pub fn table_cells( &self, ) -> impl Iterator<Item = Result<PcbTableCell, Error>> + '_
Source§impl PcbView<'_>
impl PcbView<'_>
Sourcepub fn annular_ring_stats(&self) -> Result<PcbAnnularRingStats, Error>
pub fn annular_ring_stats(&self) -> Result<PcbAnnularRingStats, Error>
Observe through-hole pad and via rings using authored size/drill dimensions. Pads are visited before vias. NPTH/SMD pads and negative isolated helper-pad rings are excluded; zero survives. Drill offsets, custom copper unions and layer-dependent padstacks do not alter this source-envelope statistic. The existing reader limits apply; both selected families are required.
Source§impl<'a> PcbView<'a>
impl<'a> PcbView<'a>
Sourcepub fn footprint_properties(
&self,
) -> impl Iterator<Item = Result<PcbFootprintProperty, Error>> + '_
pub fn footprint_properties( &self, ) -> impl Iterator<Item = Result<PcbFootprintProperty, Error>> + '_
Iterate requested footprint properties in board and child source order.
Sourcepub fn footprint_graphics(
&self,
) -> impl Iterator<Item = Result<PcbFootprintGraphic, Error>> + '_
pub fn footprint_graphics( &self, ) -> impl Iterator<Item = Result<PcbFootprintGraphic, Error>> + '_
Iterate requested non-text footprint graphics in board and child source order.
Sourcepub fn footprint_texts(
&self,
) -> impl Iterator<Item = Result<PcbFootprintText, Error>> + '_
pub fn footprint_texts( &self, ) -> impl Iterator<Item = Result<PcbFootprintText, Error>> + '_
Iterate footprint-local text in board and child source order.
Sourcepub fn footprint_text_boxes(
&self,
) -> impl Iterator<Item = Result<PcbFootprintTextBox, Error>> + '_
pub fn footprint_text_boxes( &self, ) -> impl Iterator<Item = Result<PcbFootprintTextBox, Error>> + '_
Iterate footprint-local text boxes in board and child source order.
Source§impl<'a> PcbView<'a>
impl<'a> PcbView<'a>
Sourcepub fn holes(&self) -> impl Iterator<Item = Result<PcbHole, Error>> + '_
pub fn holes(&self) -> impl Iterator<Item = Result<PcbHole, Error>> + '_
Iterate source-authored holes: footprint-local pad drills, then board vias.
Sourcepub fn footprint_transforms(
&self,
) -> impl Iterator<Item = Result<PcbFootprintTransform, Error>> + '_
pub fn footprint_transforms( &self, ) -> impl Iterator<Item = Result<PcbFootprintTransform, Error>> + '_
Iterate explicit footprint-local to board placement facts in source order.
Sourcepub fn profile_primitives(
&self,
) -> impl Iterator<Item = Result<PcbProfilePrimitive, Error>> + '_
pub fn profile_primitives( &self, ) -> impl Iterator<Item = Result<PcbProfilePrimitive, Error>> + '_
Iterate top-level and footprint-local Edge.Cuts carriers.
Source§impl PcbView<'_>
impl PcbView<'_>
Sourcepub fn effective_footprint_primary_batch(
&self,
footprint_index: usize,
) -> Result<PcbFootprintPrimaryBatch, Error>
pub fn effective_footprint_primary_batch( &self, footprint_index: usize, ) -> Result<PcbFootprintPrimaryBatch, Error>
Acquire ordered primary history once, then reduce each graphical slot independently with the existing reducer. Acquisition validates all primary leaves before any drawing capability error can be recovered. Original declarations, reader limits and singular operations are unchanged.
Source§impl PcbView<'_>
impl PcbView<'_>
pub fn effective_footprint_primary_values( &self, footprint_index: usize, ) -> Result<BTreeMap<String, String>, Error>
pub fn effective_footprint_primary_fields( &self, footprint_index: usize, ) -> Result<Vec<PcbFootprintProperty>, Error>
pub fn effective_footprint_primary_field( &self, footprint_index: usize, name: &str, ) -> Result<Option<PcbFootprintProperty>, Error>
Source§impl<'a> PcbView<'a>
impl<'a> PcbView<'a>
Sourcepub fn setup_tenting(&self) -> Result<Option<PcbFrontBackOptionalBool>, Error>
pub fn setup_tenting(&self) -> Result<Option<PcbFrontBackOptionalBool>, Error>
Authored setup tenting flags; absence differs from an explicit no.
Existing effective setup defaults remain available through setup.
Sourcepub fn effective_auxiliary_origin(&self) -> Result<PcbPoint, Error>
pub fn effective_auxiliary_origin(&self) -> Result<PcbPoint, Error>
Effective KiCad auxiliary datum in CAD coordinates, including the zero default. An absent declaration/setup does not become authored evidence.
pub fn setup(&self) -> Result<Option<PcbSetup>, Error>
Sourcepub fn effective_setup(&self) -> Result<PcbSetup, Error>
pub fn effective_setup(&self) -> Result<PcbSetup, Error>
The authored setup, or KiCad’s defaults when the board has no (setup)
form: pcbnew loads such a board with its default design settings.
Source§impl PcbView<'_>
impl PcbView<'_>
Sourcepub fn dimension_text(
&self,
index: usize,
) -> Result<Option<PcbBoardText>, Error>
pub fn dimension_text( &self, index: usize, ) -> Result<Option<PcbBoardText>, Error>
Read the actual nested text of a selected dimension through the existing
source text decoder. The index belongs to dimensions() source order.
Sourcepub fn board_texts(
&self,
) -> impl Iterator<Item = Result<PcbBoardText, Error>> + '_
pub fn board_texts( &self, ) -> impl Iterator<Item = Result<PcbBoardText, Error>> + '_
Read selected board text in source order without invoking the plotter. Cache presence is retained even when a plotter would reject its content.
Sourcepub fn board_text_boxes(
&self,
) -> impl Iterator<Item = Result<PcbBoardTextBox, Error>> + '_
pub fn board_text_boxes( &self, ) -> impl Iterator<Item = Result<PcbBoardTextBox, Error>> + '_
Read selected board text boxes in source order; the index is the graphic’s position among all board graphics, as for board text.
Source§impl PcbView<'_>
impl PcbView<'_>
Sourcepub fn remove_top_level_by_id(&self, identifier: &str) -> Result<PcbEdit, Error>
pub fn remove_top_level_by_id(&self, identifier: &str) -> Result<PcbEdit, Error>
Remove one unambiguous identified top-level object by uuid or legacy id.
Sourcepub fn set_property(&self, name: &str, value: &str) -> Result<PcbEdit, Error>
pub fn set_property(&self, name: &str, value: &str) -> Result<PcbEdit, Error>
Replace one unambiguous top-level board property without rewriting the board.
Source§impl PcbView<'_>
impl PcbView<'_>
Sourcepub fn embedded_files(
&self,
) -> impl Iterator<Item = Result<PcbEmbeddedFile, Error>> + '_
pub fn embedded_files( &self, ) -> impl Iterator<Item = Result<PcbEmbeddedFile, Error>> + '_
Iterate board-owned embedded resources in source order.
This preserves the pre-existing board-scope behavior. Use
Self::footprint_embedded_files or Self::all_embedded_files for
nested declarations.
Sourcepub fn footprint_embedded_files(
&self,
) -> impl Iterator<Item = Result<PcbEmbeddedFile, Error>> + '_
pub fn footprint_embedded_files( &self, ) -> impl Iterator<Item = Result<PcbEmbeddedFile, Error>> + '_
Iterate footprint-owned embedded resources in board and child source order.
Sourcepub fn all_embedded_files(
&self,
) -> impl Iterator<Item = Result<PcbEmbeddedFile, Error>> + '_
pub fn all_embedded_files( &self, ) -> impl Iterator<Item = Result<PcbEmbeddedFile, Error>> + '_
Iterate all board and embedded-footprint resource declarations.
Sourcepub fn embedded_file_encoded_data(
&self,
file: &PcbEmbeddedFile,
maximum: usize,
) -> Result<Option<String>, Error>
pub fn embedded_file_encoded_data( &self, file: &PcbEmbeddedFile, maximum: usize, ) -> Result<Option<String>, Error>
Return the exact joined base64 payload without decoding it.
None means no (data ...) form was authored; Some("") is an
explicitly empty payload.
Sourcepub fn decode_embedded_file(
&self,
file: &PcbEmbeddedFile,
) -> Result<Option<Vec<u8>>, Error>
pub fn decode_embedded_file( &self, file: &PcbEmbeddedFile, ) -> Result<Option<Vec<u8>>, Error>
Decode and checksum-verify one zstd/base64 payload on demand.
Source§impl<'a> PcbView<'a>
impl<'a> PcbView<'a>
Sourcepub fn parse(source: &'a str, limits: PcbLimits) -> Result<Self, Error>
pub fn parse(source: &'a str, limits: PcbLimits) -> Result<Self, Error>
Validate one kicad_pcb root and index its major domain families.
Sourcepub fn parse_selected(
source: &'a str,
limits: PcbLimits,
selection: PcbSelection,
) -> Result<Self, Error>
pub fn parse_selected( source: &'a str, limits: PcbLimits, selection: PcbSelection, ) -> Result<Self, Error>
Validate a board and index only the requested families plus dependencies.
pub fn counts(&self) -> PcbCounts
pub fn source(&self) -> &'a str
pub fn selection(&self) -> PcbSelection
pub fn root_span(&self) -> &FormSpan
Sourcepub fn top_level_forms(&self) -> impl Iterator<Item = &FormSpan>
pub fn top_level_forms(&self) -> impl Iterator<Item = &FormSpan>
Iterate exact top-level spans in source order, including unknown forms.
pub fn unknown_top_level_forms(&self) -> impl Iterator<Item = &FormSpan>
pub fn layers(&self) -> impl Iterator<Item = Result<PcbLayer, Error>> + '_
pub fn nets(&self) -> impl Iterator<Item = Result<PcbNet, Error>> + '_
pub fn properties( &self, ) -> impl Iterator<Item = Result<PcbProperty, Error>> + '_
pub fn footprints( &self, ) -> impl Iterator<Item = Result<PcbFootprint, Error>> + '_
pub fn pads(&self) -> impl Iterator<Item = Result<PcbPad, Error>> + '_
pub fn models( &self, ) -> impl Iterator<Item = Result<PcbModelReference, Error>> + '_
pub fn segments(&self) -> impl Iterator<Item = Result<PcbSegment, Error>> + '_
pub fn vias(&self) -> impl Iterator<Item = Result<PcbVia, Error>> + '_
pub fn zones(&self) -> impl Iterator<Item = Result<PcbZone, Error>> + '_
Sourcepub fn footprint_zones(
&self,
) -> impl Iterator<Item = Result<PcbFootprintZone, Error>> + '_
pub fn footprint_zones( &self, ) -> impl Iterator<Item = Result<PcbFootprintZone, Error>> + '_
Iterate requested footprint-owned zones and rule areas in board and child source order. KiCad stores their outlines in board coordinates.
pub fn graphics(&self) -> impl Iterator<Item = Result<PcbGraphic, Error>> + '_
pub fn arcs(&self) -> impl Iterator<Item = Result<PcbRoutingArc, Error>> + '_
pub fn dimensions( &self, ) -> impl Iterator<Item = Result<PcbDimension, Error>> + '_
pub fn groups(&self) -> impl Iterator<Item = Result<PcbGroup, Error>> + '_
pub fn generated_items( &self, ) -> impl Iterator<Item = Result<PcbGeneratedItem, Error>> + '_
Source§impl PcbView<'_>
impl PcbView<'_>
Sourcepub fn locate_footprint_features(
&self,
selectors: &[PcbFootprintFeatureSelector],
) -> Result<PcbLocatedFeatures, Error>
pub fn locate_footprint_features( &self, selectors: &[PcbFootprintFeatureSelector], ) -> Result<PcbLocatedFeatures, Error>
Resolve exact effective Reference and exact opaque graphic UUID/tstamp tokens. Missing or ambiguous optional selectors diagnose their own scope; native read errors propagate.