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

FootprintView

Struct FootprintView 

Source
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>

Source

pub fn parse(source: &'a str, limits: FootprintLimits) -> Result<Self, Error>

Validate and index the top-level footprint, properties, and pads.

Source

pub fn name(&self) -> Result<Cow<'a, str>, Error>

Decode the footprint name without materializing its child forms.

Source

pub fn pad_count(&self) -> usize

Source

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.

Source

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.

Source

pub fn models( &self, ) -> impl Iterator<Item = Result<PcbModelReference, Error>> + '_

Decode standalone 3D model references in source order.

Source

pub fn graphics(&self) -> impl Iterator<Item = Result<PcbGraphic, Error>> + '_

Decode non-text footprint graphics in source order.

Source

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).

Source

pub fn embedded_files( &self, ) -> impl Iterator<Item = Result<EmbeddedFile, Error>> + '_

Inspect standalone-footprint resource declarations without decoding payloads.

Source

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.

Source

pub fn decode_embedded_file( &self, file: &EmbeddedFile, ) -> Result<Option<Vec<u8>>, Error>

Decode and checksum-verify one zstd/base64 payload on demand.

Source

pub fn properties( &self, ) -> impl Iterator<Item = Result<FootprintProperty<'a>, Error>> + '_

Decode properties one at a time from their selected source ranges.

Source

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<'_>

Source

pub fn custom_parameters(&self) -> Result<BTreeMap<String, String>, Error>

Standalone-owned custom values, excluding source-version standard/system fields.

Source

pub fn primary_property_name( &self, name: &str, ) -> Result<Option<&'static str>, Error>

Classify one exact original property under this source file’s version.

Source

pub fn effective_primary_values( &self, ) -> Result<BTreeMap<String, String>, Error>

Source-ordered exact primary values; missing and explicitly empty differ.

Source

pub fn effective_primary_fields( &self, ) -> Result<Vec<FootprintGraphicalProperty>, Error>

Resolve authored primary slots into existing property records.

Source

pub fn effective_primary_field( &self, name: &str, ) -> Result<Option<FootprintGraphicalProperty>, Error>

A per-slot read allows a caller to localize unsupported source history.

Source

pub fn graphical_properties( &self, ) -> impl Iterator<Item = Result<FootprintGraphicalProperty, Error>> + '_

Decode graphical property facts from their selected top-level spans.

Source

pub fn texts(&self) -> impl Iterator<Item = Result<FootprintText, Error>> + '_

Decode footprint-local fp_text carriers in source order.

Source

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>

Source§

fn clone(&self) -> FootprintView<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for FootprintView<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for FootprintView<'a>

§

impl<'a> RefUnwindSafe for FootprintView<'a>

§

impl<'a> Send for FootprintView<'a>

§

impl<'a> Sync for FootprintView<'a>

§

impl<'a> Unpin for FootprintView<'a>

§

impl<'a> UnsafeUnpin for FootprintView<'a>

§

impl<'a> UnwindSafe for FootprintView<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.