pub enum ValidationError {
Show 22 variants
LinkUnknownFromNode {
link_id: String,
node_index: usize,
},
LinkUnknownToNode {
link_id: String,
node_index: usize,
},
UnknownPatternRef {
object_id: String,
pattern_id: String,
},
UnknownCurveRef {
object_id: String,
curve_id: String,
},
WrongCurveKind {
object_id: String,
curve_id: String,
expected: CurveKind,
actual: CurveKind,
},
MissingRequiredCurve {
object_id: String,
expected_kind: CurveKind,
},
UnknownNodeIdRef {
object_id: String,
node_id: String,
},
UnknownNodeIndexRef {
object_id: String,
node_index: usize,
},
UnknownLinkIndexRef {
object_id: String,
link_index: usize,
},
LinkSelfLoop {
link_id: String,
},
NoReservoir,
NodeNotReachable {
node_id: String,
},
TankLevelOutOfRange {
node_id: String,
min_level: f64,
initial_level: f64,
max_level: f64,
},
PumpCurveNotDecreasing {
curve_id: String,
},
EfficiencyCurveYOutOfRange {
curve_id: String,
},
TankVolumeCurveYNotIncreasing {
curve_id: String,
},
GpvHeadlossCurveYDecreasing {
curve_id: String,
},
CurveXNotIncreasing {
curve_id: String,
},
PatternEmpty {
pattern_id: String,
},
RuleActionUnknownLink {
rule_priority: f64,
link_index: usize,
},
CurveTooFewPoints {
curve_id: String,
count: usize,
},
ControlUnknownLink {
control_index: usize,
link_index: usize,
},
}Expand description
A validation error produced by Network::validate (§2.9).
Each variant identifies the offending object by its string ID and the constraint violated — as required by §8.1.2.
Variants§
LinkUnknownFromNode
from_node index of a link names a node that does not exist.
Fields
LinkUnknownToNode
to_node index of a link names a node that does not exist.
Fields
UnknownPatternRef
A pattern ID referenced by an object does not exist.
Fields
UnknownCurveRef
A curve ID referenced by an object does not exist.
Fields
WrongCurveKind
A curve exists but has the wrong kind for the reference.
Fields
MissingRequiredCurve
A required curve reference (e.g. pump head curve) is absent.
Fields
UnknownNodeIdRef
A node string ID referenced by an object does not exist.
Fields
UnknownNodeIndexRef
A node index in a control or rule premise is out of range.
Fields
UnknownLinkIndexRef
A link index in a rule premise is out of range.
Fields
LinkSelfLoop
A link connects a node to itself.
NoReservoir
The network has no reservoir (fixed-grade node).
NodeNotReachable
A junction or tank not reachable from any reservoir.
TankLevelOutOfRange
A tank’s initial_level is outside [min_level, max_level].
Fields
PumpCurveNotDecreasing
A PUMP_HEAD curve’s y-values are not strictly decreasing.
EfficiencyCurveYOutOfRange
A PUMP_EFFICIENCY curve’s y-values are not all in (0, 100].
TankVolumeCurveYNotIncreasing
A TANK_VOLUME curve’s y-values are not strictly increasing.
GpvHeadlossCurveYDecreasing
A GPV_HEADLOSS curve’s y-values are not non-decreasing.
CurveXNotIncreasing
A curve’s x-values are not strictly increasing.
PatternEmpty
A pattern contains no factors.
RuleActionUnknownLink
A rule action references a link index that is out of range.
Fields
CurveTooFewPoints
A curve has fewer than 2 data points (§2.3 requires length ≥ 2).
Fields
ControlUnknownLink
A simple control references a link index that is out of range.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl PartialEq for ValidationError
impl PartialEq for ValidationError
Source§fn eq(&self, other: &ValidationError) -> bool
fn eq(&self, other: &ValidationError) -> bool
self and other values to be equal, and is used by ==.