pub enum Error {
Range,
Inexact,
}
Expand description
Error types for conversions
Variants§
Range
Source value lies outside of target type’s range
Inexact
Loss of precision and/or outside of target type’s range
Trait Implementations§
Source§impl Error for Error
Available on crate feature std
only.
impl Error for Error
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()
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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
Source§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
Source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
Source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
Source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Available on crate features
std
or libm
only.Cast to integer, truncating Read more
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Available on crate features
std
or libm
only.Cast to the nearest integer Read more
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Available on crate features
std
or libm
only.Cast the floor to an integer Read more
Source§fn cast_ceil(self) -> T
fn cast_ceil(self) -> T
Available on crate features
std
or libm
only.Cast the ceiling to an integer Read more
Source§fn try_cast_trunc(self) -> Result<T, Error>
fn try_cast_trunc(self) -> Result<T, Error>
Available on crate features
std
or libm
only.Try converting to integer with truncation Read more
Source§fn try_cast_nearest(self) -> Result<T, Error>
fn try_cast_nearest(self) -> Result<T, Error>
Available on crate features
std
or libm
only.Try converting to the nearest integer Read more