Enum awint_core::SerdeError
source · pub enum SerdeError {
Show 13 variants
Empty,
EmptyInteger,
EmptyFraction,
EmptyExponent,
EmptyBitwidth,
EmptyFixedPoint,
InvalidChar,
InvalidRadix,
ZeroBitwidth,
NonEqualWidths,
NegativeUnsigned,
Fractional,
Overflow,
}
Expand description
A serialization or deserialization error
Variants§
Empty
The input is empty
EmptyInteger
The input is missing the integer part, even if it has a bitwidth or other part.
EmptyFraction
A fraction is given but it is empty
EmptyExponent
An exponent suffix is given but it is empty
EmptyBitwidth
A bitwidth suffix is given but it is empty
EmptyFixedPoint
A fixed point suffix is given but it is empty
InvalidChar
There is an unrecognized character that is not _
, -
, 0..=9
,
a..=z
, or A..=Z
depending on the radix and other context
InvalidRadix
A radix is not in the range 2..=36
ZeroBitwidth
If an input bitwidth is zero
NonEqualWidths
If some kind of width does not match in contexts that require equal widths
NegativeUnsigned
An input was marked as both negative and unsigned
Fractional
If a fraction or negative exponent was used without fixed point mode
Overflow
The value represented by the string cannot fit in the specified unsigned or signed integer. This may also be thrown in case of internal algorithms failing from extreme string lengths approaching memory exhaustion.
Trait Implementations§
source§impl Clone for SerdeError
impl Clone for SerdeError
source§fn clone(&self) -> SerdeError
fn clone(&self) -> SerdeError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SerdeError
impl Debug for SerdeError
source§impl Display for SerdeError
impl Display for SerdeError
source§impl Hash for SerdeError
impl Hash for SerdeError
source§impl Ord for SerdeError
impl Ord for SerdeError
source§fn cmp(&self, other: &SerdeError) -> Ordering
fn cmp(&self, other: &SerdeError) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for SerdeError
impl PartialEq for SerdeError
source§fn eq(&self, other: &SerdeError) -> bool
fn eq(&self, other: &SerdeError) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for SerdeError
impl PartialOrd for SerdeError
source§fn partial_cmp(&self, other: &SerdeError) -> Option<Ordering>
fn partial_cmp(&self, other: &SerdeError) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more