#[non_exhaustive]pub enum Error {
Show 24 variants
MissingField(&'static str),
ShortRow {
field: &'static str,
row: usize,
expected: usize,
got: usize,
},
BadFloat {
field: &'static str,
row: usize,
value: String,
},
BadId {
field: &'static str,
row: usize,
message: String,
},
UnbalancedBrackets(&'static str),
UnknownBus {
bus_id: BusId,
element_index: usize,
},
ZeroImpedance {
row: usize,
},
NonFiniteSusceptance {
row: usize,
},
DegenerateTap {
row: usize,
tap: f64,
},
MissingGenCost {
gen_index: usize,
},
NonFiniteGenCost {
field: &'static str,
value: f64,
},
InvalidGenCostPatch {
row: usize,
reason: String,
},
GenCostCountMismatch {
gens: usize,
gencost: usize,
},
DcLineCostCountMismatch {
dclines: usize,
dclinecost: usize,
},
NoReferenceBus,
ReferenceBusCount {
found: usize,
},
InvalidBaseMva {
base: f64,
},
InvalidNormalizeOption {
field: &'static str,
value: f64,
},
UngroundedComponent {
components: usize,
},
Io(Error),
UnlocatedElements {
buses: usize,
branches: usize,
},
FormatRead {
format: &'static str,
message: String,
},
UnknownFormat(String),
WriteUnsupported {
format: &'static str,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingField(&'static str)
ShortRow
BadFloat
BadId
UnbalancedBrackets(&'static str)
UnknownBus
ZeroImpedance
NonFiniteSusceptance
DegenerateTap
MissingGenCost
NonFiniteGenCost
InvalidGenCostPatch
GenCostCountMismatch
DcLineCostCountMismatch
NoReferenceBus
Normalization could not establish a reference bus. The reference set is
derived from generator presence: a bus keeps REF only while it hosts
an in-service generator, so a REF typed bus with no generator does not
count, and with no in-service generator there is nothing to promote.
ReferenceBusCount
An index or solver table build needs exactly one reference bus.
InvalidBaseMva
InvalidNormalizeOption
UngroundedComponent
Io(Error)
UnlocatedElements
FormatRead
UnknownFormat(String)
WriteUnsupported
The target format is recognized but read only: it has no writer. A
same-format write can still echo retained source; everything else is
refused with this error rather than a misleading Error::UnknownFormat.
Implementations§
Source§impl Error
impl Error
Sourcepub fn reference_bus_count(found: usize) -> Self
pub fn reference_bus_count(found: usize) -> Self
An index or solver table build needs exactly one reference bus and the
case states found.
Sourcepub fn code(&self) -> &'static DiagnosticInfo
pub fn code(&self) -> &'static DiagnosticInfo
The registry entry for this error. The match is exhaustive over the
variant set (no wildcard), so adding an Error variant is a compile
error here until it is coded.
Sourcepub fn category(&self) -> ErrorCategory
pub fn category(&self) -> ErrorCategory
Classify this error. The match is exhaustive over the variant set (no
wildcard), so adding an Error variant is a compile error here until it
is categorized — categorization can’t silently drift as the enum grows.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()