zerovec/varzerovec/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 core::fmt::Display;
6
7#[derive(Debug)]
8pub enum VarZeroVecFormatError {
9 /// The byte buffer was not in the appropriate format for VarZeroVec.
10 Metadata,
11 /// One of the values could not be decoded.
12 Values(crate::ule::UleError),
13}
14
15impl core::error::Error for VarZeroVecFormatError {}
16
17impl Display for VarZeroVecFormatError {
18 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
19 match self {
20 Self::Metadata => write!(f, "VarZeroVecFormatError: metadata"),
21 Self::Values(e) => write!(f, "VarZeroVecFormatError: {e}"),
22 }
23 }
24}