pub struct BcdOverflowError;Expand description
Error returned when a conversion between an integer and a BCD overflows.
§Examples
use const_bcd::{Bcd, bcd};
// A Bcd<1> can only hold two decimal digits (a value <= 99)
let err = Bcd::<1>::try_from_u8(240).unwrap_err();
assert_eq!(err.to_string(), "Overflow during BCD conversion");
let bcd: Bcd<2> = bcd!(1234u16);
let err = bcd.try_into_u8().unwrap_err();
assert_eq!(err.to_string(), "Overflow during BCD conversion");Trait Implementations§
Source§impl Clone for BcdOverflowError
impl Clone for BcdOverflowError
impl Copy for BcdOverflowError
Source§impl Debug for BcdOverflowError
impl Debug for BcdOverflowError
Source§impl Display for BcdOverflowError
impl Display for BcdOverflowError
impl Eq for BcdOverflowError
Source§impl Error for BcdOverflowError
impl Error for BcdOverflowError
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 BcdOverflowError
impl PartialEq for BcdOverflowError
impl StructuralPartialEq for BcdOverflowError
Auto Trait Implementations§
impl Freeze for BcdOverflowError
impl RefUnwindSafe for BcdOverflowError
impl Send for BcdOverflowError
impl Sync for BcdOverflowError
impl Unpin for BcdOverflowError
impl UnsafeUnpin for BcdOverflowError
impl UnwindSafe for BcdOverflowError
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