pub struct InvalidBcdDigit(/* private fields */);Expand description
Error returned when a byte contains a nibble with a value greater than 9.
BCD digits must be in the range 0..=9. Any nibble value in 10..=15 (0xA–0xF)
is invalid and will produce this error.
§Examples
use const_bcd::Bcd;
// 0xAB contains nibbles 0xA and 0xB, both invalid BCD digits
let err = Bcd::<1>::from_bcd_bytes([0xAB]).unwrap_err();
assert_eq!(err.to_string(), "Invalid BCD digit 10. Must be <= 9");Trait Implementations§
Source§impl Clone for InvalidBcdDigit
impl Clone for InvalidBcdDigit
impl Copy for InvalidBcdDigit
Source§impl Debug for InvalidBcdDigit
impl Debug for InvalidBcdDigit
Source§impl Display for InvalidBcdDigit
impl Display for InvalidBcdDigit
impl Eq for InvalidBcdDigit
Source§impl Error for InvalidBcdDigit
impl Error for InvalidBcdDigit
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 InvalidBcdDigit
impl PartialEq for InvalidBcdDigit
impl StructuralPartialEq for InvalidBcdDigit
Auto Trait Implementations§
impl Freeze for InvalidBcdDigit
impl RefUnwindSafe for InvalidBcdDigit
impl Send for InvalidBcdDigit
impl Sync for InvalidBcdDigit
impl Unpin for InvalidBcdDigit
impl UnsafeUnpin for InvalidBcdDigit
impl UnwindSafe for InvalidBcdDigit
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