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

Module library_edits

Module library_edits 

Source
Expand description

Parameterized, source-preserving edits for reusable KiCad library items.

Applications choose property, font, layer and resource policies. These operations neither discover files nor select a preferred model format.

Structs§

EmbeddedModelEdits
Exact edit scope, including intentionally dropped unsupported models. Nothing is removed by type, format, filename or URI-prefix inference. All indices refer to the original Source before any edits are applied.
FootprintArtwork
Only the supplied typed artwork is appended. Coordinate frame, layers, dimensions, text, styling and actual UUIDs remain caller choices.
FootprintEdits
Direct standalone-footprint edits. Every choice is supplied by the caller.
FootprintFieldText
Explicit Source field role plus its actual authored text/presentation. Presentation uses the same validation as AuthoredFootprintText, including visible text only; no Reference/Value string or formatting is inferred.
KeptEmbeddedModel
Exact positions in FootprintView::models() and embedded_files(). The caller selects the pair after inspecting the actual payload; this operation verifies both original Source values exactly against the supplied receipts. The caller owns pairing policy; this is not a file-format proof.
LibraryEdit
The actual output and the number of changed Source forms, not a fidelity receipt, model count or permission to publish a file.
PropertyFont
Replace the complete font child on a selected property, leaving its other effects intact. No font dimensions or property names are implicit.
SymbolLibraryEdits
Explicit complete-library property edits. None keeps all property names; Some(&[]) removes every property. Empty edit lists are no-ops.
SymbolPropertyUpdate
An explicit update or insertion selected by the caller.
SymbolPropertyValue
One direct Source property, including its exact decoded spelling.

Enums§

FootprintFieldTextKind
Actual legacy fp_text field roles, distinct from graphical properties.

Functions§

append_footprint_artwork
Validate artwork through the existing typed Source authoring operation and append its emitted forms without rewriting existing footprint bytes. This creates no inferred bounds, labels, projection or model geometry.
edit_footprint
Edit only the explicitly requested direct footprint fields.
edit_footprint_embedded_models
Rename the explicit model/file pair and remove exactly the listed model references and embedded file forms. Unselected fonts, other resources, external references and unknown forms remain byte-for-byte intact. The renamed payload, checksum and model placement also remain byte-for-byte intact. Empty resource wrappers are retained rather than sweeping unselected forms.
edit_symbol_library
Apply the same explicit policy to every symbol in a complete library, including nested symbol forms. Unselected source bytes are unchanged.
materialize_symbol_unit
Materialize the selected positive unit as unit 1 in one symbol’s exact inheritance chain. Unit 0 and all body styles survive. Other recognized positive units are removed; unknown/non-owned forms and unrelated library members retain their exact bytes. Source identifiers are exact decoded names; no implicit aliases or case-fold lookup are performed.
normalize_nonpositive_direct_pad_sizes
Repair only direct (pad ... (size x y)) fields. If either axis is nonpositive, both axes become the explicitly supplied positive dimensions. Missing size fields and nested padstack sizes are left unchanged.
remove_footprint_layer_forms
Remove any direct footprint form having a direct layer child matching an exact layer or literal prefix supplied by the caller. This deliberately includes properties and extension forms on those selected layers. Every other byte, including unknown forms and embedded payloads, stays unchanged. Empty layer/prefix sets are a no-op; no layer patterns are implicit.
symbol_property_values
Read only direct properties of one uniquely and exactly named root symbol. Duplicates are returned in Source order so the caller cannot mistake an ambiguous property for a unique match. Inherited properties are not merged.
upsert_symbol_properties
Prepare every requested edit before patching one selected symbol. Existing property values are byte patches; inserted properties use the existing typed symbol authoring validator and writer. Unknown and unselected bytes survive, including other members of a complete library.