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
impl SchematicDocument
pub fn annotation_sources( &self, limits: SchematicAnnotationSourceLimits, ) -> Result<SchematicAnnotationSourceView<'_>, SourceBundleError>
Source§impl SchematicDocument
impl SchematicDocument
pub fn connection_sources( &self, ) -> Result<SchematicConnectionSourceView<'_>, SourceBundleError>
Source§impl SchematicDocument
impl SchematicDocument
pub fn documentation_sources( &self, limits: SchematicDocumentationSourceLimits, ) -> Result<SchematicDocumentationSourceView<'_>, SourceBundleError>
Source§impl SchematicDocument
impl SchematicDocument
pub fn power_sources( &self, limits: SchematicPowerSourceLimits, ) -> Result<SchematicPowerSourceView<'_>, SourceBundleError>
Source§impl SchematicDocument
impl SchematicDocument
pub fn symbol_sources( &self, ) -> Result<SchematicSymbolSourceView<'_>, SourceBundleError>
Source§impl SchematicDocument
impl SchematicDocument
Sourcepub fn parse(source: String) -> Result<Self, SourceBundleError>
pub fn parse(source: String) -> Result<Self, SourceBundleError>
Validate and own one UTF-8 kicad_sch source using a virtual filename.
Sourcepub fn parse_named(
source_path: impl Into<String>,
source: String,
) -> Result<Self, SourceBundleError>
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.
Sourcepub fn parse_named_with_definition(
source_path: impl Into<String>,
source: String,
) -> Result<(Self, SchematicDefinition), SourceBundleError>
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.
Sourcepub fn parse_named_for_import_read_only(
source_path: impl Into<String>,
source: String,
) -> Result<SchematicImportRead, SourceBundleError>
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.
Sourcepub fn from_reader(reader: impl Read) -> Result<Self, SourceBundleError>
pub fn from_reader(reader: impl Read) -> Result<Self, SourceBundleError>
Read at most the configured source ceiling plus one sentinel byte.
Sourcepub fn from_named_reader(
source_path: impl Into<String>,
reader: impl Read,
) -> Result<Self, SourceBundleError>
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.
Sourcepub fn from_named_reader_with_definition(
source_path: impl Into<String>,
reader: impl Read,
) -> Result<(Self, SchematicDefinition), SourceBundleError>
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.
pub fn source_path(&self) -> &str
pub fn source(&self) -> &str
Sourcepub fn paper(&self) -> Result<KiCadPaper, Error>
pub fn paper(&self) -> Result<KiCadPaper, Error>
Read close-to-format paper data from this exact owned source.
pub fn into_source(self) -> String
Sourcepub fn definition(&self) -> Result<SchematicDefinition, SourceBundleError>
pub fn definition(&self) -> Result<SchematicDefinition, SourceBundleError>
Rebuild the promoted typed model over the current exact source.
Sourcepub fn write_to(&self, writer: impl Write) -> Result<(), SourceBundleError>
pub fn write_to(&self, writer: impl Write) -> Result<(), SourceBundleError>
Write the current source verbatim after checking the output ceiling.
Sourcepub fn set_symbol_property(
&mut self,
symbol_uuid: &str,
name: &str,
value: &str,
) -> Result<bool, SourceBundleError>
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.
Sourcepub fn upsert_symbol_property(
&mut self,
symbol_uuid: &str,
name: &str,
value: &str,
) -> Result<bool, SourceBundleError>
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.
Sourcepub fn remove_symbol_property(
&mut self,
symbol_uuid: &str,
name: &str,
) -> Result<bool, SourceBundleError>
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
impl SchematicDocument
Sourcepub fn bus_alias_declarations(
&self,
limits: SchematicBusSourceLimits,
) -> Result<SchematicBusAliasDeclarations<'_>, SourceBundleError>
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
impl SchematicDocument
pub fn standalone_bus_sources( &self, limits: SchematicBusSourceLimits, ) -> Result<SchematicStandaloneBusSource<'_>, SourceBundleError>
pub fn standalone_bus_sources_with_pin_context( &self, limits: SchematicBusSourceLimits, context: &SchematicNativePinContext<'_>, ) -> Result<SchematicStandaloneBusSource<'_>, SourceBundleError>
Retain original bus drawing and qualified physical contacts without parsing ranges, expanding members, or requiring a naming driver.
Trait Implementations§
Source§impl Clone for SchematicDocument
impl Clone for SchematicDocument
Source§fn clone(&self) -> SchematicDocument
fn clone(&self) -> SchematicDocument
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more