#[non_exhaustive]pub struct DistNetwork {Show 19 fields
pub name: Option<String>,
pub base_frequency: f64,
pub buses: Vec<DistBus>,
pub linecodes: Vec<DistLineCode>,
pub lines: Vec<DistLine>,
pub switches: Vec<DistSwitch>,
pub transformers: Vec<DistTransformer>,
pub loads: Vec<DistLoad>,
pub generators: Vec<DistGenerator>,
pub shunts: Vec<DistShunt>,
pub sources: Vec<VoltageSource>,
pub untyped: Vec<UntypedObject>,
pub commands: Vec<(String, String)>,
pub options: Vec<(String, String)>,
pub defaulted: BTreeMap<String, Vec<&'static str>>,
pub warnings: Vec<String>,
pub source: Option<Arc<String>>,
pub source_format: Option<DistSourceFormat>,
pub extras: Extras,
}Expand description
A multiconductor distribution network.
source retains the original text for the byte exact echo tier;
defaulted records, per element ("class.name" key), the fields the
reader materialized from format defaults rather than the source text.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: Option<String>§base_frequency: f64Hz.
buses: Vec<DistBus>§linecodes: Vec<DistLineCode>§lines: Vec<DistLine>§switches: Vec<DistSwitch>§transformers: Vec<DistTransformer>§loads: Vec<DistLoad>§generators: Vec<DistGenerator>§shunts: Vec<DistShunt>§sources: Vec<VoltageSource>BMOPF allows exactly one; the model allows any number and the BMOPF writer warns beyond the first.
untyped: Vec<UntypedObject>§commands: Vec<(String, String)>Source commands and options the typed model does not interpret
(solve, set mode=...), in order, as (verb, args).
options: Vec<(String, String)>§defaulted: BTreeMap<String, Vec<&'static str>>Per-element record of which fields were materialized from a format
default. Skipped in the .pio.json payload: the field holds
&'static str (no Deserialize), and this provenance belongs in the
compiler package’s source_maps as mapping_kind = defaulted, not in
the raw IR payload. See
https://eigenergy.github.io/powerio/guide/pio-json-schema.html.
warnings: Vec<String>§source: Option<Arc<String>>Retained source text for the byte-exact echo tier. Skipped in the
.pio.json payload (mirrors powerio::Network::source): keeping it out
avoids serde’s rc feature, and retained source is an envelope concern
surfaced through Origin::File { retained_source, .. }.
source_format: Option<DistSourceFormat>§extras: ExtrasImplementations§
Source§impl DistNetwork
impl DistNetwork
Sourcepub fn to_format(&self, format: DistTargetFormat) -> Conversion
pub fn to_format(&self, format: DistTargetFormat) -> Conversion
Writes the network in format.
Writing back to the source format echoes the retained source text
byte for byte; every cross format write regenerates from the typed
model and reports each fidelity loss in the warnings. The returned
warnings hold only the writer’s losses: parse warnings stay on
DistNetwork::warnings (the one-shot convert_str/convert_file
merge the two). After mutating a parsed model, set source = None
(and source_format), or the echo tier returns the original text
and silently discards the edits.
Source§impl DistNetwork
impl DistNetwork
pub fn new() -> Self
pub fn named(name: impl Into<String>) -> Self
Sourcepub fn bus(&self, id: &str) -> Option<&DistBus>
pub fn bus(&self, id: &str) -> Option<&DistBus>
Case insensitive, matching the source formats’ name semantics.
Sourcepub fn linecode(&self, name: &str) -> Option<&DistLineCode>
pub fn linecode(&self, name: &str) -> Option<&DistLineCode>
Case insensitive, matching the source formats’ name semantics.
Trait Implementations§
Source§impl Clone for DistNetwork
impl Clone for DistNetwork
Source§fn clone(&self) -> DistNetwork
fn clone(&self) -> DistNetwork
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more