#[non_exhaustive]
#[repr(u8)]
pub enum Error {
-Show 22 variants
WontImplement,
- NotYetImplemented,
- SerializeBufferFull(usize),
- DeserializeUnexpectedEnd,
- DeserializeBadBool,
- DeserializeBadUtf8,
- DeserializeBadEnum,
- DeserializeBadMajor,
- DeserializeBadI8,
- DeserializeBadI16,
- DeserializeBadI32,
- DeserializeBadI64,
- DeserializeBadU8,
- DeserializeBadU16,
- DeserializeBadU32,
- DeserializeBadU64,
- DeserializeExpectedNull,
- InexistentSliceToArrayError,
- DeserializeNonMinimal,
- SerdeSerCustom,
- SerdeDeCustom,
- SerdeMissingField,
+Show 22 variants
WontImplement = 0,
+ NotYetImplemented = 1,
+ SerializeBufferFull = 2,
+ DeserializeUnexpectedEnd = 3,
+ DeserializeBadBool = 4,
+ DeserializeBadUtf8 = 5,
+ DeserializeBadEnum = 6,
+ DeserializeBadMajor = 7,
+ DeserializeBadI8 = 8,
+ DeserializeBadI16 = 9,
+ DeserializeBadI32 = 10,
+ DeserializeBadI64 = 11,
+ DeserializeBadU8 = 12,
+ DeserializeBadU16 = 13,
+ DeserializeBadU32 = 14,
+ DeserializeBadU64 = 15,
+ DeserializeExpectedNull = 16,
+ InexistentSliceToArrayError = 17,
+ DeserializeNonMinimal = 18,
+ SerdeSerCustom = 19,
+ SerdeDeCustom = 20,
+ SerdeMissingField = 21,
}
Expand description
This is the error type used by cbor-smol
-
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
This is a feature that cbor-smol will never implement
-
This is a feature that cbor-smol intends to support, but does not yet
-
The serialize buffer is full
-
Hit the end of buffer, expected more data
-
Found a bool that wasn’t 0xf4 or 0xf5
-
Tried to parse invalid utf-8
-
Could not parse an enum
-
Expected a different major type
-
Expected a i8, was too large
-
Expected a i16, was too large
-
Expected a i32, was too large
-
Expected a i64, was too large
-
Inexistent slice-to-array cast error. Used here to avoid calling unwrap.
-
Value may be valid, but not encoded in minimal way
-
Serde Serialization Error
-
Serde Deserialization Error
-
Serde Missing required value
-
Performs copy-assignment from
source.
Read more
Formats the value using the given formatter.
Read more
Formats the value using the given formatter.
Read more
The lower-level source of this error, if any.
Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports.
Read more
Used when a
Serialize implementation encounters any error
-while serializing a type.
Read more
Raised when there is general error when deserializing a type.
Read more
Raised when a Deserialize struct type expected to receive a required
+
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
This is a feature that cbor-smol will never implement
+
This is a feature that cbor-smol intends to support, but does not yet
+
The serialize buffer is full
+
Hit the end of buffer, expected more data
+
Found a bool that wasn’t 0xf4 or 0xf5
+
Tried to parse invalid utf-8
+
Could not parse an enum
+
Expected a different major type
+
Expected a i8, was too large
+
Expected a i16, was too large
+
Expected a i32, was too large
+
Expected a i64, was too large
+
Inexistent slice-to-array cast error. Used here to avoid calling unwrap.
+
Value may be valid, but not encoded in minimal way
+
Serde Serialization Error
+
Serde Deserialization Error
+
Serde Missing required value
+
Performs copy-assignment from
source.
Read more
Formats the value using the given formatter.
Read more
Formats the value using the given formatter.
Read more
Raised when there is general error when deserializing a type.
Read more
Raised when a Deserialize struct type expected to receive a required
field with a particular name but that field was not present in the
-input.
Raised when a
Deserialize receives a type different from what it was
-expecting.
Read more
Raised when a
Deserialize receives a value of the right type but that
-is wrong for some other reason.
Read more
Raised when deserializing a sequence or map and the input data contains
-too many or too few elements.
Read more
Raised when a Deserialize enum type received a variant with an
-unrecognized name.
Raised when a Deserialize struct type received a field with an
-unrecognized name.
Raised when a Deserialize struct type received more than one of the
-same field.
This method tests for self and other values to be equal, and is used
+input.
Raised when a
Deserialize receives a type different from what it was
+expecting.
Read more
Raised when a
Deserialize receives a value of the right type but that
+is wrong for some other reason.
Read more
Raised when deserializing a sequence or map and the input data contains
+too many or too few elements.
Read more
Raised when a Deserialize enum type received a variant with an
+unrecognized name.
Raised when a Deserialize struct type received a field with an
+unrecognized name.
Raised when a Deserialize struct type received more than one of the
+same field.
Used when a
Serialize implementation encounters any error
+while serializing a type.
Read more
The lower-level source of this error, if any.
Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports.
Read more
This method tests for self and other values to be equal, and is used
by ==.
This method tests for !=. The default implementation is almost always
sufficient, and should not be overridden without very good reason.