Skip to main content

NetworkError

Enum NetworkError 

Source
pub enum NetworkError {
Show 47 variants EmptyNetwork, InvalidBaseMva(f64), DuplicateBusNumber(u32), NoSlackBus, InvalidBranchEndpoint { branch_from: u32, branch_to: u32, missing_bus: u32, }, SelfLoopBranch(u32), InvalidGeneratorBus(u32), InvalidGeneratorRegulatedBus { bus: u32, reg_bus: u32, }, InvalidLoadBus(u32), InvalidPowerInjectionBus(u32), InvalidFixedShuntBus(u32), InvalidDispatchableLoadBus(u32), DuplicateGeneratorId { id: String, }, InvalidSwitchedShuntBus { id: String, bus: u32, }, InvalidSwitchedShuntRegulatedBus { id: String, bus: u32, }, InvalidSwitchedShuntOpfBus { id: String, bus: u32, }, InvalidGeneratorLimits { bus: u32, }, InvalidGeneratorReactiveLimits { bus: u32, }, InvalidStorageParameters { bus: u32, source: StorageValidationError, }, InvalidBusField { bus: u32, field: &'static str, value: f64, }, InvalidLoadField { bus: u32, field: &'static str, value: f64, }, InvalidFixedShuntField { bus: u32, field: &'static str, value: f64, }, InvalidPowerInjectionField { bus: u32, field: &'static str, value: f64, }, InvalidGeneratorField { bus: u32, field: &'static str, value: f64, }, InvalidBranchField { from_bus: u32, to_bus: u32, field: &'static str, value: f64, }, InvalidBranchAngleBounds { from_bus: u32, to_bus: u32, min_rad: Option<f64>, max_rad: Option<f64>, }, InvalidSlackPlacement { buses: Vec<u32>, slack_buses: Vec<u32>, }, InvalidIsolatedBusConnectivity { bus: u32, }, NonFiniteBusVoltage(u32), InvalidBusVoltageBounds(u32, f64, f64), NonFiniteBranchImpedance(u32, u32), DuplicateBranchKey { from_bus: u32, to_bus: u32, circuit: String, }, MissingTopologyMapping, StaleNodeBreakerTopology, InvalidInterfaceDefinition { name: String, detail: String, }, InvalidFlowgateDefinition { name: String, detail: String, }, DuplicateAreaScheduleNumber(u32), InvalidAreaScheduleSlackBus { area: u32, slack_bus: u32, }, InvalidAreaScheduleField { area: u32, field: &'static str, value: f64, }, DuplicateHvdcLinkName { name: String, }, InvalidHvdcLinkEndpoint { name: String, bus: u32, }, DuplicateDcGridId { id: u32, }, DuplicateDcBusId { grid_id: u32, bus_id: u32, }, InvalidDcConverterAcBus { grid_id: u32, ac_bus: u32, }, InvalidDcConverterDcBus { grid_id: u32, dc_bus: u32, }, InvalidDcBranchEndpoint { grid_id: u32, from_bus: u32, to_bus: u32, missing_bus: u32, }, MixedHvdcRepresentation,
}
Expand description

Structured error type returned by Network::validate.

Variants§

§

EmptyNetwork

The network has no buses.

§

InvalidBaseMva(f64)

base_mva is not positive or not finite.

§

DuplicateBusNumber(u32)

Two or more buses share the same external bus number.

§

NoSlackBus

No bus has BusType::Slack (every network needs at least one angle reference).

§

InvalidBranchEndpoint

A branch references a bus number that does not exist in the bus list.

Fields

§branch_from: u32
§branch_to: u32
§missing_bus: u32
§

SelfLoopBranch(u32)

A branch has the same bus on both ends.

§

InvalidGeneratorBus(u32)

A generator references a bus number not present in the bus list.

§

InvalidGeneratorRegulatedBus

A generator references a remote regulated bus number not present in the bus list.

Fields

§bus: u32
§reg_bus: u32
§

InvalidLoadBus(u32)

A load references a bus number not present in the bus list.

§

InvalidPowerInjectionBus(u32)

A power injection references a bus number not present in the bus list.

§

InvalidFixedShuntBus(u32)

A fixed shunt references a bus number not present in the bus list.

§

InvalidDispatchableLoadBus(u32)

A dispatchable load references a bus number not present in the bus list.

§

DuplicateGeneratorId

Two generators share the same canonical ID (after whitespace trimming).

Fields

§

InvalidSwitchedShuntBus

A switched shunt references a missing host bus.

Fields

§bus: u32
§

InvalidSwitchedShuntRegulatedBus

A switched shunt references a missing regulated bus.

Fields

§bus: u32
§

InvalidSwitchedShuntOpfBus

A switched-shunt OPF relaxation references a missing host bus.

Fields

§bus: u32
§

InvalidGeneratorLimits

A generator has pmin > pmax.

Fields

§bus: u32
§

InvalidGeneratorReactiveLimits

A generator has qmin > qmax.

Fields

§bus: u32
§

InvalidStorageParameters

A storage-capable generator has invalid StorageParams (e.g. negative capacity).

§

InvalidBusField

A bus field required for solve readiness is not finite or out of range.

Fields

§bus: u32
§field: &'static str
§value: f64
§

InvalidLoadField

A load field required for solve readiness is not finite or out of range.

Fields

§bus: u32
§field: &'static str
§value: f64
§

InvalidFixedShuntField

A fixed shunt field required for solve readiness is not finite or out of range.

Fields

§bus: u32
§field: &'static str
§value: f64
§

InvalidPowerInjectionField

A power injection field required for solve readiness is not finite or out of range.

Fields

§bus: u32
§field: &'static str
§value: f64
§

InvalidGeneratorField

A generator field required for solve readiness is not finite or out of range.

Fields

§bus: u32
§field: &'static str
§value: f64
§

InvalidBranchField

A branch field required for solve readiness is not finite or out of range.

Fields

§from_bus: u32
§to_bus: u32
§field: &'static str
§value: f64
§

InvalidBranchAngleBounds

Branch angle-difference limits are finite but inverted.

Fields

§from_bus: u32
§to_bus: u32
§min_rad: Option<f64>
§max_rad: Option<f64>
§

InvalidSlackPlacement

A bus component does not have exactly one slack bus.

Fields

§buses: Vec<u32>
§slack_buses: Vec<u32>
§

InvalidIsolatedBusConnectivity

An isolated bus is still connected by an in-service branch.

Fields

§bus: u32
§

NonFiniteBusVoltage(u32)

A bus has NaN or Inf in its voltage magnitude or angle initial condition.

§

InvalidBusVoltageBounds(u32, f64, f64)

A bus has non-finite or inverted voltage bounds (vmin > vmax).

§

NonFiniteBranchImpedance(u32, u32)

A branch has NaN or Inf in r, x, b, or tap.

§

DuplicateBranchKey

Two or more branches share the same (from_bus, to_bus, circuit) key.

Fields

§from_bus: u32
§to_bus: u32
§circuit: String
§

MissingTopologyMapping

Node-breaker topology is present but no bus-branch mapping has been built yet.

§

StaleNodeBreakerTopology

Node-breaker topology mapping is stale (switches changed since last rebuild).

§

InvalidInterfaceDefinition

An interface uses mismatched or invalid branch/coefficient metadata.

Fields

§name: String
§detail: String
§

InvalidFlowgateDefinition

A flowgate uses mismatched or invalid monitored branch/coefficient metadata.

Fields

§name: String
§detail: String
§

DuplicateAreaScheduleNumber(u32)

Two or more area schedules share the same area number.

§

InvalidAreaScheduleSlackBus

An area schedule references a missing or invalid slack bus.

Fields

§area: u32
§slack_bus: u32
§

InvalidAreaScheduleField

An area-schedule field required for runtime correctness is invalid.

Fields

§area: u32
§field: &'static str
§value: f64
§

DuplicateHvdcLinkName

Two or more point-to-point HVDC links share the same stable name.

Fields

§name: String
§

InvalidHvdcLinkEndpoint

A point-to-point HVDC link references a missing AC bus.

Fields

§name: String
§bus: u32
§

DuplicateDcGridId

Two explicit DC grids share the same canonical grid id.

Fields

§id: u32
§

DuplicateDcBusId

Two buses inside the same explicit DC grid share the same bus id.

Fields

§grid_id: u32
§bus_id: u32
§

InvalidDcConverterAcBus

An explicit DC-grid converter references a missing AC bus.

Fields

§grid_id: u32
§ac_bus: u32
§

InvalidDcConverterDcBus

An explicit DC-grid converter references a missing DC bus.

Fields

§grid_id: u32
§dc_bus: u32
§

InvalidDcBranchEndpoint

An explicit DC-grid branch references a missing DC bus.

Fields

§grid_id: u32
§from_bus: u32
§to_bus: u32
§missing_bus: u32
§

MixedHvdcRepresentation

A solve-ready network mixes the two canonical HVDC representations.

Trait Implementations§

Source§

impl Debug for NetworkError

Source§

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

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

impl Display for NetworkError

Source§

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

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

impl Error for NetworkError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more