pub struct FootprintView<'a> { /* private fields */ }Expand description
A typed standalone-footprint view that retains only selected source spans.
Implementations§
Source§impl<'a> FootprintView<'a>
impl<'a> FootprintView<'a>
Sourcepub fn parse(source: &'a str, limits: FootprintLimits) -> Result<Self, Error>
pub fn parse(source: &'a str, limits: FootprintLimits) -> Result<Self, Error>
Validate and index the top-level footprint, properties, and pads.
Sourcepub fn name(&self) -> Result<Cow<'a, str>, Error>
pub fn name(&self) -> Result<Cow<'a, str>, Error>
Decode the footprint name without materializing its child forms.
pub fn pad_count(&self) -> usize
Sourcepub fn metadata(&self) -> Result<PcbFootprint, Error>
pub fn metadata(&self) -> Result<PcbFootprint, Error>
Decode footprint metadata and local defaults using the same record as an embedded board footprint. Placement fields remain local/absent.
Sourcepub fn pads(&self) -> impl Iterator<Item = Result<PcbPad, Error>> + '_
pub fn pads(&self) -> impl Iterator<Item = Result<PcbPad, Error>> + '_
Decode standalone pads in source order. footprint_index is zero for
this single-root view; source_range is the stable member identity.
Sourcepub fn models(
&self,
) -> impl Iterator<Item = Result<PcbModelReference, Error>> + '_
pub fn models( &self, ) -> impl Iterator<Item = Result<PcbModelReference, Error>> + '_
Decode standalone 3D model references in source order.
Sourcepub fn graphics(&self) -> impl Iterator<Item = Result<PcbGraphic, Error>> + '_
pub fn graphics(&self) -> impl Iterator<Item = Result<PcbGraphic, Error>> + '_
Decode non-text footprint graphics in source order.
Sourcepub fn zones(&self) -> impl Iterator<Item = Result<PcbZone, Error>> + '_
pub fn zones(&self) -> impl Iterator<Item = Result<PcbZone, Error>> + '_
Decode the footprint’s zones and rule areas in source order, in the footprint frame (a library footprint sits at the origin).
Sourcepub fn embedded_files(
&self,
) -> impl Iterator<Item = Result<EmbeddedFile, Error>> + '_
pub fn embedded_files( &self, ) -> impl Iterator<Item = Result<EmbeddedFile, Error>> + '_
Inspect standalone-footprint resource declarations without decoding payloads.
Sourcepub fn embedded_file_encoded_data(
&self,
file: &EmbeddedFile,
maximum: usize,
) -> Result<Option<String>, Error>
pub fn embedded_file_encoded_data( &self, file: &EmbeddedFile, maximum: usize, ) -> Result<Option<String>, Error>
Return one resource’s joined base64 text without decompressing it.
Sourcepub fn decode_embedded_file(
&self,
file: &EmbeddedFile,
) -> Result<Option<Vec<u8>>, Error>
pub fn decode_embedded_file( &self, file: &EmbeddedFile, ) -> Result<Option<Vec<u8>>, Error>
Decode and checksum-verify one zstd/base64 payload on demand.
Sourcepub fn properties(
&self,
) -> impl Iterator<Item = Result<FootprintProperty<'a>, Error>> + '_
pub fn properties( &self, ) -> impl Iterator<Item = Result<FootprintProperty<'a>, Error>> + '_
Decode properties one at a time from their selected source ranges.
Sourcepub fn set_property(
&self,
name: &str,
value: &str,
max_output_bytes: usize,
) -> Result<FootprintEdit, Error>
pub fn set_property( &self, name: &str, value: &str, max_output_bytes: usize, ) -> Result<FootprintEdit, Error>
Replace an existing top-level property value and preserve every other byte.
Source§impl FootprintView<'_>
impl FootprintView<'_>
Sourcepub fn custom_parameters(&self) -> Result<BTreeMap<String, String>, Error>
pub fn custom_parameters(&self) -> Result<BTreeMap<String, String>, Error>
Standalone-owned custom values, excluding source-version standard/system fields.
Sourcepub fn primary_property_name(
&self,
name: &str,
) -> Result<Option<&'static str>, Error>
pub fn primary_property_name( &self, name: &str, ) -> Result<Option<&'static str>, Error>
Classify one exact original property under this source file’s version.
Sourcepub fn effective_primary_values(
&self,
) -> Result<BTreeMap<String, String>, Error>
pub fn effective_primary_values( &self, ) -> Result<BTreeMap<String, String>, Error>
Source-ordered exact primary values; missing and explicitly empty differ.
Sourcepub fn effective_primary_fields(
&self,
) -> Result<Vec<FootprintGraphicalProperty>, Error>
pub fn effective_primary_fields( &self, ) -> Result<Vec<FootprintGraphicalProperty>, Error>
Resolve authored primary slots into existing property records.
Sourcepub fn effective_primary_field(
&self,
name: &str,
) -> Result<Option<FootprintGraphicalProperty>, Error>
pub fn effective_primary_field( &self, name: &str, ) -> Result<Option<FootprintGraphicalProperty>, Error>
A per-slot read allows a caller to localize unsupported source history.
Sourcepub fn graphical_properties(
&self,
) -> impl Iterator<Item = Result<FootprintGraphicalProperty, Error>> + '_
pub fn graphical_properties( &self, ) -> impl Iterator<Item = Result<FootprintGraphicalProperty, Error>> + '_
Decode graphical property facts from their selected top-level spans.
Sourcepub fn texts(&self) -> impl Iterator<Item = Result<FootprintText, Error>> + '_
pub fn texts(&self) -> impl Iterator<Item = Result<FootprintText, Error>> + '_
Decode footprint-local fp_text carriers in source order.
Sourcepub fn text_boxes(
&self,
) -> impl Iterator<Item = Result<FootprintTextBox, Error>> + '_
pub fn text_boxes( &self, ) -> impl Iterator<Item = Result<FootprintTextBox, Error>> + '_
Decode standalone fp_text_box carriers in source order.
Trait Implementations§
Source§impl<'a> Clone for FootprintView<'a>
impl<'a> Clone for FootprintView<'a>
Source§fn clone(&self) -> FootprintView<'a>
fn clone(&self) -> FootprintView<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more