pub enum GeneralError<T> {
NegOverflow(T),
PosOverflow(T),
Unrepresentable(T),
}
Expand description
A general error enumeration that subsumes all other conversion errors.
This exists primarily as a “catch-all” for reliably unifying various different kinds of conversion errors.
Variants§
NegOverflow(T)
Input was too negative for the target type.
PosOverflow(T)
Input was too positive for the target type.
Unrepresentable(T)
Input was not representable in the target type.
Implementations§
Source§impl<T> GeneralError<T>
impl<T> GeneralError<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Returns the value stored in this error.
Trait Implementations§
Source§impl<T: Clone> Clone for GeneralError<T>
impl<T: Clone> Clone for GeneralError<T>
Source§fn clone(&self) -> GeneralError<T>
fn clone(&self) -> GeneralError<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T> Debug for GeneralError<T>
impl<T> Debug for GeneralError<T>
Source§impl<T> Display for GeneralError<T>
impl<T> Display for GeneralError<T>
Source§impl<T> Error for GeneralError<T>where
T: Any,
impl<T> Error for GeneralError<T>where
T: Any,
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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
Source§impl<T> From<FloatError<T>> for GeneralError<T>
impl<T> From<FloatError<T>> for GeneralError<T>
Source§fn from(e: FloatError<T>) -> GeneralError<T>
fn from(e: FloatError<T>) -> GeneralError<T>
Converts to this type from the input type.
Source§impl<T> From<GeneralError<T>> for GeneralErrorKind
impl<T> From<GeneralError<T>> for GeneralErrorKind
Source§fn from(e: GeneralError<T>) -> Self
fn from(e: GeneralError<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<NegOverflow<T>> for GeneralError<T>
impl<T> From<NegOverflow<T>> for GeneralError<T>
Source§fn from(e: NegOverflow<T>) -> Self
fn from(e: NegOverflow<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<NoError> for GeneralError<T>
impl<T> From<NoError> for GeneralError<T>
Source§impl<T> From<PosOverflow<T>> for GeneralError<T>
impl<T> From<PosOverflow<T>> for GeneralError<T>
Source§fn from(e: PosOverflow<T>) -> Self
fn from(e: PosOverflow<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<RangeError<T>> for GeneralError<T>
impl<T> From<RangeError<T>> for GeneralError<T>
Source§fn from(e: RangeError<T>) -> Self
fn from(e: RangeError<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<Unrepresentable<T>> for GeneralError<T>
impl<T> From<Unrepresentable<T>> for GeneralError<T>
Source§fn from(e: Unrepresentable<T>) -> Self
fn from(e: Unrepresentable<T>) -> Self
Converts to this type from the input type.
Source§impl<T: Ord> Ord for GeneralError<T>
impl<T: Ord> Ord for GeneralError<T>
Source§fn cmp(&self, other: &GeneralError<T>) -> Ordering
fn cmp(&self, other: &GeneralError<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for GeneralError<T>
impl<T: PartialEq> PartialEq for GeneralError<T>
Source§impl<T: PartialOrd> PartialOrd for GeneralError<T>
impl<T: PartialOrd> PartialOrd for GeneralError<T>
impl<T: Copy> Copy for GeneralError<T>
impl<T: Eq> Eq for GeneralError<T>
impl<T> StructuralPartialEq for GeneralError<T>
Auto Trait Implementations§
impl<T> Freeze for GeneralError<T>where
T: Freeze,
impl<T> RefUnwindSafe for GeneralError<T>where
T: RefUnwindSafe,
impl<T> Send for GeneralError<T>where
T: Send,
impl<T> Sync for GeneralError<T>where
T: Sync,
impl<T> Unpin for GeneralError<T>where
T: Unpin,
impl<T> UnwindSafe for GeneralError<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.