hydr_structures/structures/
applicability.rs1#[derive(Clone, Debug, PartialEq, Eq)]
5pub struct OrificeApplicability {
6 pub coefficient_provenance: String,
8 pub fully_submerged_applicability: String,
10 pub symmetric_reversal: bool,
12}
13impl OrificeApplicability {
14 pub(crate) fn check(&self) -> Result<(), super::StructureError> {
15 super::definition::text(&self.coefficient_provenance, "coefficient_provenance")?;
16 super::definition::text(
17 &self.fully_submerged_applicability,
18 "fully_submerged_applicability",
19 )
20 }
21}
22
23#[derive(Clone, Debug, PartialEq, Eq)]
25pub struct CulvertApplicability {
26 pub coefficient_provenance: String,
28 pub barrel_condition_assertion: String,
30}
31impl CulvertApplicability {
32 pub(crate) fn check(&self) -> Result<(), super::StructureError> {
33 super::definition::text(&self.coefficient_provenance, "coefficient_provenance")?;
34 super::definition::text(
35 &self.barrel_condition_assertion,
36 "barrel_condition_assertion",
37 )
38 }
39}
40
41#[derive(Clone, Debug, PartialEq, Eq)]
43pub struct WeirApplicability {
44 pub coefficient_provenance: String,
46 pub free_nappe_and_approach_assertion: String,
48 pub submergence_correction_assertion: String,
50 pub symmetric_reversal: bool,
52}
53impl WeirApplicability {
54 pub(crate) fn check(&self) -> Result<(), super::StructureError> {
55 for (value, field) in [
56 (&self.coefficient_provenance, "coefficient_provenance"),
57 (
58 &self.free_nappe_and_approach_assertion,
59 "free_nappe_and_approach_assertion",
60 ),
61 (
62 &self.submergence_correction_assertion,
63 "submergence_correction_assertion",
64 ),
65 ] {
66 super::definition::text(value, field)?;
67 }
68 Ok(())
69 }
70}