1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use displaydoc::Display;

/// Error types for the `zerotrie` crate.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Display)]
#[non_exhaustive]
pub enum Error {
    /// Non-ASCII data was added to an ASCII-only collection.
    #[displaydoc("Non-ASCII cannot be added to an ASCII-only collection")]
    NonAsciiError,
    /// The collection reached its maximum supported capacity.
    #[displaydoc("Reached maximum capacity of collection")]
    CapacityExceeded,
    /// The builder could not solve the perfect hash function.
    #[displaydoc("Failed to solve the perfect hash function. This is rare! Please report your case to the ICU4X team.")]
    CouldNotSolvePerfectHash,
    /// Mixed-case data was added to a case-insensitive trie.
    #[displaydoc("Mixed-case data added to case-insensitive trie")]
    MixedCase,
}