#[non_exhaustive]pub enum JsonNumberError {
OutOfRange,
NotAnInteger,
NotFinite,
InvalidNumber,
}Expand description
An error from a JsonNumber conversion.
#[non_exhaustive]: new kinds may be added in a future release.
Variants (Non-exhaustive)§
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.
OutOfRange
The value does not fit the target integer type.
NotAnInteger
The value is not an integer (it has a fraction or exponent).
NotFinite
The value is not a finite number (e.g. an exponent that overflows f64).
InvalidNumber
The string is not a valid JSON number.
Trait Implementations§
Source§impl Clone for JsonNumberError
impl Clone for JsonNumberError
Source§fn clone(&self) -> JsonNumberError
fn clone(&self) -> JsonNumberError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for JsonNumberError
Source§impl Debug for JsonNumberError
impl Debug for JsonNumberError
Source§impl Display for JsonNumberError
impl Display for JsonNumberError
impl Eq for JsonNumberError
Source§impl Error for JsonNumberError
Available on crate feature std only.
impl Error for JsonNumberError
Available on crate feature
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for JsonNumberError
impl PartialEq for JsonNumberError
Source§fn eq(&self, other: &JsonNumberError) -> bool
fn eq(&self, other: &JsonNumberError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for JsonNumberError
Auto Trait Implementations§
impl Freeze for JsonNumberError
impl RefUnwindSafe for JsonNumberError
impl Send for JsonNumberError
impl Sync for JsonNumberError
impl Unpin for JsonNumberError
impl UnsafeUnpin for JsonNumberError
impl UnwindSafe for JsonNumberError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more