pub struct Bint {
pub value: u8,
pub boundary: u8,
}
Expand description
Bint: A bounded integer.
Returns a struct that represents an unsigned integer and a boundary that represents when the value will be reset to 0.
Usage:
use bint::Bint;
let b: Bint = Bint {value: 5, boundary: 6 };
let c: Bint = b.up();
let d: Bint = c.up();
assert_eq!(5, b.value);
assert_eq!(0, c.value);
assert_eq!(1, d.value);
Fields§
§value: u8
§boundary: u8
Implementations§
Trait Implementations§
source§impl PartialEq for Bint
impl PartialEq for Bint
impl Copy for Bint
impl Eq for Bint
impl StructuralPartialEq for Bint
Auto Trait Implementations§
impl Freeze for Bint
impl RefUnwindSafe for Bint
impl Send for Bint
impl Sync for Bint
impl Unpin for Bint
impl UnwindSafe for Bint
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