| 1 | // This file is part of ICU4X. For terms of use, please see the file |
| 2 | // called LICENSE at the top level of the ICU4X source tree |
| 3 | // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). |
| 4 | |
| 5 | //! Custom error type(s) for the parent module. |
| 6 | |
| 7 | use displaydoc::Display; |
| 8 | |
| 9 | /// A custom error type for [`CodePointTrie`](super::CodePointTrie). |
| 10 | /// |
| 11 | /// Re-exported as [Error][super::Error]. |
| 12 | #[derive (Copy, Clone, Display, Debug, PartialEq)] |
| 13 | #[non_exhaustive ] |
| 14 | pub enum Error { |
| 15 | /// Could not construct [`CodePointTrie`](super::CodePointTrie) from deserialized values |
| 16 | #[displaydoc("Could not construct CodePointTrie from deserialized values: {reason}" )] |
| 17 | FromDeserialized { |
| 18 | /// Reason for inability to deserialize values. |
| 19 | reason: &'static str, |
| 20 | }, |
| 21 | /// [`CodePointTrie`](super::CodePointTrie) must be constructed from data vector with at least one element |
| 22 | #[displaydoc("CodePointTrie must be constructed from data vector with at least one element" )] |
| 23 | EmptyDataVector, |
| 24 | } |
| 25 | |