Skip to main content

DistNetwork

Struct DistNetwork 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: Option<String>§base_frequency: f64

Hz.

§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: Extras

Implementations§

Source§

impl DistNetwork

Source

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

Source

pub fn new() -> Self

Source

pub fn named(name: impl Into<String>) -> Self

Source

pub fn bus(&self, id: &str) -> Option<&DistBus>

Case insensitive, matching the source formats’ name semantics.

Source

pub fn linecode(&self, name: &str) -> Option<&DistLineCode>

Case insensitive, matching the source formats’ name semantics.

Trait Implementations§

Source§

impl Clone for DistNetwork

Source§

fn clone(&self) -> DistNetwork

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DistNetwork

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for DistNetwork

Source§

fn default() -> Self

An empty network at the OpenDSS default frequency. A derived 0 Hz default would put NaN into every capacitance the dss writer converts through omega.

Source§

impl<'de> Deserialize<'de> for DistNetwork

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for DistNetwork

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,