1use super::evaluator::ConditionResult;
8
9pub use super::timezone::{dst_transitions_between, is_mesz_utc, is_mez_utc, parse_dtm303};
11pub use super::werktag::{
12 compute_easter, is_german_holiday, is_werktag, parse_ccyymmdd_prefix, werktage_between,
13};
14
15pub fn validate_max_decimal_places(value: &str, max: usize) -> ConditionResult {
26 if value.is_empty() {
27 return ConditionResult::Unknown;
28 }
29 let decimal_places = match value.find('.') {
30 Some(pos) => value.len() - pos - 1,
31 None => 0,
32 };
33 ConditionResult::from(decimal_places <= max)
34}
35
36pub fn validate_max_integer_digits(value: &str, max: usize) -> ConditionResult {
40 if value.is_empty() {
41 return ConditionResult::Unknown;
42 }
43 let s = value.strip_prefix('-').unwrap_or(value);
44 let integer_part = match s.find('.') {
45 Some(pos) => &s[..pos],
46 None => s,
47 };
48 ConditionResult::from(integer_part.len() <= max)
49}
50
51pub fn validate_numeric(value: &str, op: &str, threshold: f64) -> ConditionResult {
63 if value.is_empty() {
64 return ConditionResult::Unknown;
65 }
66 let parsed = match edifact_number(value) {
67 Some(v) => v,
68 None => return ConditionResult::False,
69 };
70 let result = match op {
71 "==" => (parsed - threshold).abs() < f64::EPSILON,
72 "!=" => (parsed - threshold).abs() >= f64::EPSILON,
73 ">" => parsed > threshold,
74 ">=" => parsed >= threshold,
75 "<" => parsed < threshold,
76 "<=" => parsed <= threshold,
77 _ => return ConditionResult::Unknown,
78 };
79 ConditionResult::from(result)
80}
81
82pub fn is_edifact_number(value: &str) -> bool {
86 edifact_number(value).is_some()
87}
88
89fn edifact_number(value: &str) -> Option<f64> {
92 let unsigned = value.strip_prefix('-').unwrap_or(value);
93 let mut marks = 0;
94 let mut digits = 0;
95 for c in unsigned.chars() {
96 match c {
97 '0'..='9' => digits += 1,
98 '.' | ',' => marks += 1,
99 _ => return None,
100 }
101 }
102 if digits == 0 || marks > 1 {
103 return None;
104 }
105 value.replace(',', ".").parse().ok()
106}
107
108pub fn validate_hhmm_equals(dtm_value: &str, expected_hhmm: &str) -> ConditionResult {
117 if dtm_value.len() < 12 {
118 return ConditionResult::False;
120 }
121 ConditionResult::from(&dtm_value[8..12] == expected_hhmm)
122}
123
124pub fn validate_hhmm_range(dtm_value: &str, min: &str, max: &str) -> ConditionResult {
128 if dtm_value.len() < 12 {
129 return ConditionResult::False;
130 }
131 let hhmm = &dtm_value[8..12];
132 ConditionResult::from(hhmm >= min && hhmm <= max)
133}
134
135pub fn validate_mmddhhmm_equals(dtm_value: &str, expected: &str) -> ConditionResult {
141 if dtm_value.len() < 12 {
142 return ConditionResult::False;
143 }
144 ConditionResult::from(&dtm_value[4..12] == expected)
145}
146
147pub fn validate_timezone_utc(dtm_value: &str) -> ConditionResult {
158 if dtm_value.len() < 15 || !dtm_value.is_char_boundary(dtm_value.len() - 3) {
159 return ConditionResult::False;
161 }
162 ConditionResult::from(&dtm_value[dtm_value.len() - 3..] == "+00")
163}
164
165pub fn validate_email(value: &str) -> ConditionResult {
171 if value.is_empty() {
172 return ConditionResult::Unknown;
173 }
174 ConditionResult::from(value.contains('@') && value.contains('.'))
175}
176
177pub fn validate_phone(value: &str) -> ConditionResult {
182 if value.is_empty() {
183 return ConditionResult::Unknown;
184 }
185 if !value.starts_with('+') || value.len() < 2 {
186 return ConditionResult::from(false);
187 }
188 ConditionResult::from(value[1..].chars().all(|c| c.is_ascii_digit()))
189}
190
191pub fn validate_malo_id(value: &str) -> ConditionResult {
205 if value.len() != 11 {
206 return ConditionResult::from(false);
207 }
208 if !value.chars().all(|c| c.is_ascii_digit()) {
209 return ConditionResult::from(false);
210 }
211 let digits: Vec<u32> = value.chars().filter_map(|c| c.to_digit(10)).collect();
212 let check = digits[10];
213 let mut sum = 0u32;
214 for (i, &d) in digits[..10].iter().enumerate() {
215 if (i + 1) % 2 == 0 {
217 sum += 2 * d;
218 } else {
219 sum += d;
220 }
221 }
222 let expected = (10 - (sum % 10)) % 10;
223 ConditionResult::from(check == expected)
224}
225
226pub fn validate_tr_id(value: &str) -> ConditionResult {
228 if value.is_empty() {
229 return ConditionResult::Unknown;
230 }
231 ConditionResult::from(value.len() <= 35 && value.chars().all(|c| c.is_ascii_alphanumeric()))
232}
233
234fn validate_prefixed_location_id(value: &str, prefix: char) -> ConditionResult {
237 let mut chars = value.chars();
238 ConditionResult::from(
239 value.len() == 11
240 && chars.next() == Some(prefix)
241 && chars.all(|c| c.is_ascii_digit() || c.is_ascii_uppercase()),
242 )
243}
244
245pub fn validate_sr_id(value: &str) -> ConditionResult {
248 validate_prefixed_location_id(value, 'C')
249}
250
251pub fn validate_nelo_id(value: &str) -> ConditionResult {
253 validate_prefixed_location_id(value, 'E')
254}
255
256pub fn parse_obis(value: &str) -> Option<(u32, u32)> {
273 let value = value.trim();
274 let (_ab, cde) = value.split_once(':')?;
276 let cde = cde.split('*').next()?;
278 let mut parts = cde.split('.');
279 let c = parts.next()?.parse::<u32>().ok()?;
280 let d = parts.next()?.parse::<u32>().ok()?;
281 Some((c, d))
282}
283
284pub fn obis_tariff(value: &str) -> Option<u32> {
288 let (_ab, cde) = value.trim().split_once(':')?;
289 let cde = cde.split('*').next()?;
290 let mut parts = cde.split('.');
291 parts.next()?.parse::<u32>().ok()?;
292 parts.next()?.parse::<u32>().ok()?;
293 parts.next()?.parse::<u32>().ok()
294}
295
296pub fn is_obis_wirkarbeit_kumuliert(value: &str) -> bool {
302 matches!(parse_obis(value), Some((1 | 2, 8 | 9)))
303}
304
305pub fn is_obis_wirkarbeit_quarter_hour(value: &str) -> bool {
312 matches!(parse_obis(value), Some((1 | 2, 29)))
313}
314
315pub fn is_energy_register_obis(value: &str) -> bool {
321 value.trim().starts_with("1-") && matches!(parse_obis(value), Some((1..=8, 8)))
322}
323
324pub fn validate_x509_cert_body(value: &str) -> ConditionResult {
343 let trimmed = value.trim();
344 if trimmed.is_empty() {
345 return ConditionResult::Unknown;
346 }
347 let body = trimmed
350 .trim_start_matches("-----BEGIN CERTIFICATE-----")
351 .trim_end_matches("-----END CERTIFICATE-----")
352 .trim();
353 let chars_ok = body.chars().all(|c| {
354 c.is_ascii_alphanumeric() || matches!(c, '+' | '/' | '=' | '\n' | '\r' | '\t' | ' ')
355 });
356 let len_ok = body.chars().filter(|c| !c.is_whitespace()).count() >= 100;
359 ConditionResult::from(chars_ok && len_ok)
360}
361
362pub fn validate_zahlpunkt(value: &str) -> ConditionResult {
364 if value.len() != 33 {
365 return ConditionResult::from(false);
366 }
367 ConditionResult::from(value.chars().all(|c| c.is_ascii_alphanumeric()))
368}
369
370pub fn validate_malo_or_zahlpunkt(value: &str) -> ConditionResult {
372 if value.len() == 11 && validate_malo_id(value).is_true() {
373 return ConditionResult::True;
374 }
375 if value.len() == 33 && validate_zahlpunkt(value).is_true() {
376 return ConditionResult::True;
377 }
378 ConditionResult::False
379}
380
381pub fn validate_artikel_pattern(value: &str, segment_lengths: &[usize]) -> ConditionResult {
390 if value.is_empty() {
391 return ConditionResult::Unknown;
392 }
393 let parts: Vec<&str> = value.split('-').collect();
394 if parts.len() != segment_lengths.len() {
395 return ConditionResult::from(false);
396 }
397 let valid = parts
398 .iter()
399 .zip(segment_lengths.iter())
400 .all(|(part, &expected_len)| {
401 part.len() == expected_len && part.chars().all(|c| c.is_ascii_digit())
402 });
403 ConditionResult::from(valid)
404}
405
406pub fn validate_exact_length(value: &str, expected: usize) -> ConditionResult {
410 if value.is_empty() {
411 return ConditionResult::Unknown;
412 }
413 ConditionResult::from(value.len() == expected)
414}
415
416pub fn validate_max_length(value: &str, max: usize) -> ConditionResult {
418 if value.is_empty() {
419 return ConditionResult::Unknown;
420 }
421 ConditionResult::from(value.len() <= max)
422}
423
424pub fn validate_all_digits(value: &str) -> ConditionResult {
426 if value.is_empty() {
427 return ConditionResult::Unknown;
428 }
429 ConditionResult::from(value.chars().all(|c| c.is_ascii_digit()))
430}
431
432pub fn utc_now_ccyymmddhhmm() -> String {
434 chrono::Utc::now().format("%Y%m%d%H%M").to_string()
435}
436
437pub fn german_local_time(value: &str) -> Option<chrono::NaiveDateTime> {
444 use chrono::{Datelike, Duration, NaiveDate, NaiveDateTime, Weekday};
445 let value = value.replace('?', "");
446 let stamp = NaiveDateTime::parse_from_str(value.get(..12)?, "%Y%m%d%H%M").ok()?;
447 let offset: i64 = match value.get(12..) {
448 None | Some("") => 0,
449 Some(zone) => zone.parse().ok()?,
450 };
451 let utc = stamp - Duration::hours(offset);
452 let switch = |month: u32| {
453 let mut day = NaiveDate::from_ymd_opt(utc.year(), month, 31)?;
454 while day.weekday() != Weekday::Sun {
455 day = day.pred_opt()?;
456 }
457 day.and_hms_opt(1, 0, 0)
458 };
459 let summer = utc >= switch(3)? && utc < switch(10)?;
460 Some(utc + Duration::hours(if summer { 2 } else { 1 }))
461}
462
463#[cfg(test)]
464mod tests {
465 #[test]
466 fn the_tariff_is_the_e_of_c_d_e() {
467 use super::obis_tariff;
468 assert_eq!(obis_tariff("1-1:1.8.1"), Some(1));
469 assert_eq!(obis_tariff("1-0:2.8.62*255"), Some(62));
470 assert_eq!(obis_tariff("1-0:1.8.0"), Some(0));
471 assert_eq!(obis_tariff("1-0:1.8"), None);
472 assert_eq!(obis_tariff("x"), None);
473 }
474
475 #[test]
476 fn energy_registers_are_c_8_e_with_c_one_to_eight() {
477 use super::is_energy_register_obis;
478 for obis in ["1-1:1.8.0", "1-0:2.8.1", "1-1:8.8.0", "1-1:1.8.63", "1-65:3.8.2"] {
479 assert!(is_energy_register_obis(obis), "{obis}");
480 }
481 for obis in ["1-1:1.29.0", "1-1:2.29.0", "1-1:9.8.0", "7-0:3.0.0", "1-1:1.9.0", "x"] {
482 assert!(!is_energy_register_obis(obis), "{obis}");
483 }
484 }
485
486 use super::*;
487
488 #[test]
491 fn test_max_decimal_places() {
492 assert_eq!(
493 validate_max_decimal_places("123.45", 2),
494 ConditionResult::True
495 );
496 assert_eq!(
497 validate_max_decimal_places("123.456", 2),
498 ConditionResult::False
499 );
500 assert_eq!(validate_max_decimal_places("123", 2), ConditionResult::True);
501 assert_eq!(validate_max_decimal_places("0.1", 3), ConditionResult::True);
502 assert_eq!(validate_max_decimal_places("", 2), ConditionResult::Unknown);
503 }
504
505 #[test]
506 fn test_no_decimal_places() {
507 assert_eq!(validate_max_decimal_places("100", 0), ConditionResult::True);
508 assert_eq!(
509 validate_max_decimal_places("100.5", 0),
510 ConditionResult::False
511 );
512 }
513
514 #[test]
515 fn test_max_integer_digits() {
516 assert_eq!(
517 validate_max_integer_digits("1234", 4),
518 ConditionResult::True
519 );
520 assert_eq!(
521 validate_max_integer_digits("12345", 4),
522 ConditionResult::False
523 );
524 assert_eq!(
525 validate_max_integer_digits("-123.45", 4),
526 ConditionResult::True
527 );
528 assert_eq!(validate_max_integer_digits("", 4), ConditionResult::Unknown);
529 }
530
531 #[test]
534 fn test_validate_numeric() {
535 assert_eq!(validate_numeric("5.0", ">=", 0.0), ConditionResult::True);
536 assert_eq!(validate_numeric("-1.0", ">=", 0.0), ConditionResult::False);
537 assert_eq!(validate_numeric("1", "==", 1.0), ConditionResult::True);
538 assert_eq!(validate_numeric("2", "==", 1.0), ConditionResult::False);
539 assert_eq!(validate_numeric("0", ">", 0.0), ConditionResult::False);
540 assert_eq!(validate_numeric("1", ">", 0.0), ConditionResult::True);
541 assert_eq!(validate_numeric("abc", ">=", 0.0), ConditionResult::False);
544 assert_eq!(
545 validate_numeric("O5D2DXBG1A", ">", 0.0),
546 ConditionResult::False
547 );
548 assert_eq!(validate_numeric("NaN", ">", 0.0), ConditionResult::False);
549 assert_eq!(validate_numeric("inf", ">", 0.0), ConditionResult::False);
550 assert_eq!(validate_numeric("1e3", ">", 0.0), ConditionResult::False);
551 assert_eq!(validate_numeric("0,5", ">", 0.0), ConditionResult::True);
553 assert_eq!(validate_numeric("-2", "<=", 0.0), ConditionResult::True);
554 assert_eq!(validate_numeric("", ">", 0.0), ConditionResult::Unknown);
555 }
556
557 #[test]
560 fn test_hhmm_equals() {
561 assert_eq!(
562 validate_hhmm_equals("202601012200+00", "2200"),
563 ConditionResult::True
564 );
565 assert_eq!(
566 validate_hhmm_equals("202601012300+00", "2200"),
567 ConditionResult::False
568 );
569 assert_eq!(
570 validate_hhmm_equals("short", "2200"),
571 ConditionResult::False
572 );
573 }
574
575 #[test]
576 fn test_hhmm_range() {
577 assert_eq!(
578 validate_hhmm_range("202601011530+00", "0000", "2359"),
579 ConditionResult::True
580 );
581 assert_eq!(
582 validate_hhmm_range("202601010000+00", "0000", "2359"),
583 ConditionResult::True
584 );
585 assert_eq!(
586 validate_hhmm_range("202601012359+00", "0000", "2359"),
587 ConditionResult::True
588 );
589 }
590
591 #[test]
592 fn test_mmddhhmm_equals() {
593 assert_eq!(
594 validate_mmddhhmm_equals("202612312300+00", "12312300"),
595 ConditionResult::True
596 );
597 assert_eq!(
598 validate_mmddhhmm_equals("202601012200+00", "12312300"),
599 ConditionResult::False
600 );
601 }
602
603 #[test]
604 fn test_timezone_utc() {
605 assert_eq!(
606 validate_timezone_utc("202601012200+00"),
607 ConditionResult::True
608 );
609 assert_eq!(
610 validate_timezone_utc("202601012200+01"),
611 ConditionResult::False
612 );
613 assert_eq!(
614 validate_timezone_utc("202601012200"),
615 ConditionResult::False
616 );
617 assert_eq!(
619 validate_timezone_utc("20260101220000+00"),
620 ConditionResult::True
621 );
622 assert_eq!(
623 validate_timezone_utc("20260101220000+01"),
624 ConditionResult::False
625 );
626 }
627
628 #[test]
631 fn test_email() {
632 assert_eq!(validate_email("user@example.com"), ConditionResult::True);
633 assert_eq!(validate_email("nope"), ConditionResult::False);
634 assert_eq!(validate_email("has@but-no-dot"), ConditionResult::False);
635 assert_eq!(validate_email(""), ConditionResult::Unknown);
636 }
637
638 #[test]
639 fn test_phone() {
640 assert_eq!(validate_phone("+4930123456"), ConditionResult::True);
641 assert_eq!(validate_phone("030123456"), ConditionResult::False);
642 assert_eq!(validate_phone("+"), ConditionResult::False);
643 assert_eq!(validate_phone("+49 30 123"), ConditionResult::False); assert_eq!(validate_phone(""), ConditionResult::Unknown);
645 }
646
647 #[test]
650 fn test_malo_id() {
651 assert_eq!(validate_malo_id("51238696781"), ConditionResult::True);
655 assert_eq!(validate_malo_id("41373559241"), ConditionResult::True);
656 assert_eq!(validate_malo_id("56789012345"), ConditionResult::True);
657 assert_eq!(validate_malo_id("52935155442"), ConditionResult::True);
658
659 assert_eq!(validate_malo_id("41373559240"), ConditionResult::False); assert_eq!(validate_malo_id("512386967890"), ConditionResult::False); assert_eq!(validate_malo_id("1234567890"), ConditionResult::False); assert_eq!(validate_malo_id("abcdefghijk"), ConditionResult::False); }
665
666 #[test]
667 fn test_zahlpunkt() {
668 let valid = "DE0001234567890123456789012345678";
669 assert_eq!(valid.len(), 33);
670 assert_eq!(validate_zahlpunkt(valid), ConditionResult::True);
671 assert_eq!(validate_zahlpunkt("tooshort"), ConditionResult::False);
672 }
673
674 #[test]
677 fn test_artikel_pattern() {
678 assert_eq!(
679 validate_artikel_pattern("1-23-4", &[1, 2, 1]),
680 ConditionResult::True
681 );
682 assert_eq!(
683 validate_artikel_pattern("1-23-4-567", &[1, 2, 1, 3]),
684 ConditionResult::True
685 );
686 assert_eq!(
687 validate_artikel_pattern("1-23-4-56", &[1, 2, 1, 3]),
688 ConditionResult::False
689 );
690 assert_eq!(
691 validate_artikel_pattern("1-AB-4", &[1, 2, 1]),
692 ConditionResult::False
693 );
694 assert_eq!(
695 validate_artikel_pattern("", &[1, 2, 1]),
696 ConditionResult::Unknown
697 );
698 }
699
700 #[test]
703 fn test_tr_id() {
704 assert_eq!(validate_tr_id("ABC123"), ConditionResult::True);
705 assert_eq!(validate_tr_id("A"), ConditionResult::True);
706 assert_eq!(validate_tr_id(&"A".repeat(35)), ConditionResult::True);
707 assert_eq!(validate_tr_id(&"A".repeat(36)), ConditionResult::False);
708 assert_eq!(validate_tr_id("has spaces"), ConditionResult::False);
709 assert_eq!(validate_tr_id("has-dash"), ConditionResult::False);
710 assert_eq!(validate_tr_id(""), ConditionResult::Unknown);
711 }
712
713 #[test]
714 fn test_parse_obis() {
715 assert_eq!(parse_obis("1-1:1.8.0"), Some((1, 8)));
716 assert_eq!(parse_obis("1-1:2.29.0"), Some((2, 29)));
717 assert_eq!(parse_obis("1-0:1.8.0*255"), Some((1, 8))); assert_eq!(parse_obis(" 1-1:1.8.0 "), Some((1, 8))); assert_eq!(parse_obis("no-colon"), None);
720 assert_eq!(parse_obis("1-1:abc.8.0"), None);
721 assert_eq!(parse_obis(""), None);
722 }
723
724 #[test]
725 fn test_obis_wirkarbeit_kumuliert() {
726 assert!(is_obis_wirkarbeit_kumuliert("1-1:1.8.0"));
728 assert!(is_obis_wirkarbeit_kumuliert("1-1:2.8.0"));
729 assert!(is_obis_wirkarbeit_kumuliert("1-1:1.9.0"));
730 assert!(is_obis_wirkarbeit_kumuliert("1-1:2.9.0"));
731 assert!(is_obis_wirkarbeit_kumuliert("1-0:1.8.0*255"));
732 assert!(!is_obis_wirkarbeit_kumuliert("1-1:3.8.0"));
734 assert!(!is_obis_wirkarbeit_kumuliert("1-1:4.8.0"));
735 assert!(!is_obis_wirkarbeit_kumuliert("1-1:1.29.0"));
737 assert!(!is_obis_wirkarbeit_kumuliert("1-1:1.5.0"));
739 }
740
741 #[test]
742 fn test_obis_wirkarbeit_quarter_hour() {
743 assert!(is_obis_wirkarbeit_quarter_hour("1-1:1.29.0"));
745 assert!(is_obis_wirkarbeit_quarter_hour("1-1:2.29.0"));
746 assert!(is_obis_wirkarbeit_quarter_hour("1-0:1.29.0*255"));
747 assert!(!is_obis_wirkarbeit_quarter_hour("1-1:1.8.0"));
749 assert!(!is_obis_wirkarbeit_quarter_hour("1-1:1.9.0"));
750 assert!(!is_obis_wirkarbeit_quarter_hour("1-1:3.29.0"));
752 }
753
754 #[test]
755 fn test_x509_cert_body() {
756 let body = "A".repeat(600);
758 assert_eq!(validate_x509_cert_body(&body), ConditionResult::True);
759
760 let pem_body = "A".repeat(64) + "\n" + &"B".repeat(64) + "\n" + &"C".repeat(64);
762 assert_eq!(validate_x509_cert_body(&pem_body), ConditionResult::True);
763
764 let armored = format!(
766 "-----BEGIN CERTIFICATE-----\n{}\n-----END CERTIFICATE-----",
767 "A".repeat(200)
768 );
769 assert_eq!(validate_x509_cert_body(&armored), ConditionResult::True);
770
771 let with_punct = "AB+/==".to_string() + &"A".repeat(200);
773 assert_eq!(validate_x509_cert_body(&with_punct), ConditionResult::True);
774
775 assert_eq!(validate_x509_cert_body("QUJD"), ConditionResult::False);
777
778 let invalid_chars = "A".repeat(200) + "!@#";
780 assert_eq!(
781 validate_x509_cert_body(&invalid_chars),
782 ConditionResult::False
783 );
784
785 assert_eq!(validate_x509_cert_body(""), ConditionResult::Unknown);
787 assert_eq!(validate_x509_cert_body(" \n "), ConditionResult::Unknown);
788 }
789
790 #[test]
794 fn test_sr_id() {
795 for real in ["C816417ST77", "CZZ6M5DGSS5", "COPFWS2EX96"] {
796 assert_eq!(validate_sr_id(real), ConditionResult::True, "{real}");
797 }
798 assert_eq!(
799 validate_sr_id("51238696781"),
800 ConditionResult::False,
801 "a MaLo-ID"
802 );
803 assert_eq!(validate_sr_id("C12345"), ConditionResult::False);
804 assert_eq!(validate_sr_id(""), ConditionResult::False);
805 }
806
807 #[test]
811 fn test_nelo_id() {
812 for real in ["E1688117482", "EU5UQAWW8D0", "EEW7TM7V906"] {
813 assert_eq!(validate_nelo_id(real), ConditionResult::True, "{real}");
814 }
815 assert_eq!(
816 validate_nelo_id("51238696781"),
817 ConditionResult::False,
818 "a MaLo-ID"
819 );
820 assert_eq!(validate_nelo_id("E123"), ConditionResult::False);
821 assert_eq!(validate_nelo_id("e1688117482"), ConditionResult::False);
822 }
823
824 #[test]
827 fn test_exact_length() {
828 assert_eq!(
829 validate_exact_length("1234567890123456", 16),
830 ConditionResult::True
831 );
832 assert_eq!(validate_exact_length("123", 16), ConditionResult::False);
833 assert_eq!(validate_exact_length("", 16), ConditionResult::Unknown);
834 }
835
836 #[test]
837 fn test_all_digits() {
838 assert_eq!(validate_all_digits("12345"), ConditionResult::True);
839 assert_eq!(validate_all_digits("123a5"), ConditionResult::False);
840 assert_eq!(validate_all_digits(""), ConditionResult::Unknown);
841 }
842}