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

SchematicDocument

Struct SchematicDocument 

Source
pub struct SchematicDocument { /* private fields */ }
Expand description

One owned KiCad schematic source.

Unknown forms remain in the exact source buffer. Typed state is rebuilt on demand, avoiding a self-referential model and ensuring that every mutation is semantically reparsed before it replaces the current source.

Implementations§

Source§

impl SchematicDocument

Source§

impl SchematicDocument

Source§

impl SchematicDocument

Source§

impl SchematicDocument

Source§

impl SchematicDocument

Source§

impl SchematicDocument

Source§

impl SchematicDocument

Source

pub fn parse(source: String) -> Result<Self, SourceBundleError>

Validate and own one UTF-8 kicad_sch source using a virtual filename.

Source

pub fn parse_named( source_path: impl Into<String>, source: String, ) -> Result<Self, SourceBundleError>

Validate and own one UTF-8 kicad_sch source with its portable path.

Source

pub fn parse_named_with_definition( source_path: impl Into<String>, source: String, ) -> Result<(Self, SchematicDefinition), SourceBundleError>

Validate one named source and retain the typed definition produced by that exact validation pass.

Source

pub fn parse_named_for_import_read_only( source_path: impl Into<String>, source: String, ) -> Result<SchematicImportRead, SourceBundleError>

Read exact source for an importer, recovering only malformed scalar-wire and junction content rows. All structural/root/other semantic failures remain fatal. Even valid input produces a read-only document.

Source

pub fn from_reader(reader: impl Read) -> Result<Self, SourceBundleError>

Read at most the configured source ceiling plus one sentinel byte.

Source

pub fn from_named_reader( source_path: impl Into<String>, reader: impl Read, ) -> Result<Self, SourceBundleError>

Read and validate one named schematic without an unbounded input copy.

Source

pub fn from_named_reader_with_definition( source_path: impl Into<String>, reader: impl Read, ) -> Result<(Self, SchematicDefinition), SourceBundleError>

Read, validate, and return the typed definition from the same bounded parse rather than reparsing the retained source immediately.

Source

pub fn source_path(&self) -> &str

Source

pub fn source(&self) -> &str

Source

pub fn paper(&self) -> Result<KiCadPaper, Error>

Read close-to-format paper data from this exact owned source.

Source

pub fn into_source(self) -> String

Source

pub fn definition(&self) -> Result<SchematicDefinition, SourceBundleError>

Rebuild the promoted typed model over the current exact source.

Source

pub fn write_to(&self, writer: impl Write) -> Result<(), SourceBundleError>

Write the current source verbatim after checking the output ceiling.

Source

pub fn set_symbol_property( &mut self, symbol_uuid: &str, name: &str, value: &str, ) -> Result<bool, SourceBundleError>

Replace one existing property on one unambiguous placed symbol UUID.

Source

pub fn upsert_symbol_property( &mut self, symbol_uuid: &str, name: &str, value: &str, ) -> Result<bool, SourceBundleError>

Update or insert one property on one unambiguous placed symbol UUID.

Source

pub fn remove_symbol_property( &mut self, symbol_uuid: &str, name: &str, ) -> Result<bool, SourceBundleError>

Remove one property from one unambiguous placed symbol UUID.

Source§

impl SchematicDocument

Source

pub fn bus_alias_declarations( &self, limits: SchematicBusSourceLimits, ) -> Result<SchematicBusAliasDeclarations<'_>, SourceBundleError>

Capture only explicit root declarations, including empty/conflicting/ duplicate/cyclic expressions as raw authored input. Opens no context.

Source§

impl SchematicDocument

Trait Implementations§

Source§

impl Clone for SchematicDocument

Source§

fn clone(&self) -> SchematicDocument

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 Debug for SchematicDocument

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.