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(#[automatically_derived]
impl ::core::fmt::Debug for VarZeroVecFormatError {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            VarZeroVecFormatError::Metadata =>
                ::core::fmt::Formatter::write_str(f, "Metadata"),
            VarZeroVecFormatError::Values(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Values",
                    &__self_0),
        }
    }
}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 => f.write_fmt(format_args!("VarZeroVecFormatError: metadata"))write!(f, "VarZeroVecFormatError: metadata"),
21            Self::Values(e) => f.write_fmt(format_args!("VarZeroVecFormatError: {0}", e))write!(f, "VarZeroVecFormatError: {e}"),
22        }
23    }
24}