pub struct Number<T: Ordinal + Copy>(/* private fields */);
Expand description
Represent numbers as ordinals when displayed.
§Examples
use ordinal_trait::Ordinal as _;
let n = 12.to_number();
assert_eq!(*n, 12);
assert_eq!(format!("{n}"), "12th");
Implementations§
Trait Implementations§
Source§impl<T: Ord + Ordinal + Copy> Ord for Number<T>
impl<T: Ord + Ordinal + Copy> Ord for Number<T>
Source§impl<T: PartialOrd + Ordinal + Copy> PartialOrd for Number<T>
impl<T: PartialOrd + Ordinal + Copy> PartialOrd for Number<T>
impl<T: Copy + Ordinal + Copy> Copy for Number<T>
impl<T: Eq + Ordinal + Copy> Eq for Number<T>
impl<T: Ordinal + Copy> StructuralPartialEq for Number<T>
Auto Trait Implementations§
impl<T> Freeze for Number<T>where
T: Freeze,
impl<T> RefUnwindSafe for Number<T>where
T: RefUnwindSafe,
impl<T> Send for Number<T>where
T: Send,
impl<T> Sync for Number<T>where
T: Sync,
impl<T> Unpin for Number<T>where
T: Unpin,
impl<T> UnwindSafe for Number<T>where
T: UnwindSafe,
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