#[non_exhaustive]pub enum Error {
Show 28 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,
},
ClosedSwitch {
row: usize,
from: BusId,
to: BusId,
closed: usize,
},
BusMergeRule {
message: String,
},
MergedFlowShape {
what: &'static str,
expected: usize,
got: usize,
},
Io(Error),
UnlocatedElements {
buses: usize,
branches: usize,
},
FormatRead {
format: &'static str,
message: String,
},
Emit {
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
ClosedSwitch
Closed switches join buses that a calculation which models no
switches would leave apart: raised by
IndexedNetwork::check_closed_switches
and by normalization under
ClosedSwitchPolicy::Refuse or
when its requested merge leaves an eligible closed switch in place.
BusMergeRule
A BusMergeRule that cannot be applied.
MergedFlowShape
A merged network solution whose shape does not match the merge.
Io(Error)
UnlocatedElements
FormatRead
Emit
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()