tinystr/error.rs
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
5use displaydoc::Display;
6
7impl core::error::Error for ParseError {}
8
9#[derive(Display, Debug, PartialEq, Eq)]
10#[non_exhaustive]
11pub enum ParseError {
12 #[displaydoc("found string of larger length {len} when constructing string of length {max}")]
13 TooLong { max: usize, len: usize },
14 #[displaydoc("tinystr types do not support strings with null bytes")]
15 ContainsNull,
16 #[displaydoc("attempted to construct TinyAsciiStr from a non-ASCII string")]
17 NonAscii,
18}