calendrical_calculations/
error.rs

1// This file is part of ICU4X.
2//
3// The contents of this file implement algorithms from Calendrical Calculations
4// by Reingold & Dershowitz, Cambridge University Press, 4th edition (2018),
5// which have been released as Lisp code at <https://github.com/EdReingold/calendar-code2/>
6// under the Apache-2.0 license. Accordingly, this file is released under
7// the Apache License, Version 2.0 which can be found at the calendrical_calculations
8// package root or at http://www.apache.org/licenses/LICENSE-2.0.
9
10use displaydoc::Display;
11
12/// A list of error outcomes for exceeding location bounds
13#[derive(Display, Debug, Copy, Clone, PartialEq)]
14#[non_exhaustive]
15pub enum LocationOutOfBoundsError {
16    /// Latitude value was out of bounds
17    #[displaydoc("Latitude {0} outside bounds of -90 to 90")]
18    Latitude(f64),
19
20    /// Longitude value was out of bounds
21    #[displaydoc("Longitude {0} outside bounds of -180 to 180")]
22    Longitude(f64),
23
24    /// Offset value was out of bounds
25    #[displaydoc("Offset {0} outside bounds of {1} to {2}")]
26    Offset(f64, f64, f64),
27}
28
29impl core::error::Error for LocationOutOfBoundsError {}