pub trait Integer: ToIntegerImpl + Copy { }Expand description
An abstraction over all integer types.
Integers can be formatted as Subscript, Subscript or VulgarFraction.
Use this trait if you want to abstract over integers that can be formatted by one of this crate’s formats:
use fmtastic::{Subscript, Integer};
assert_eq!("x₁", x_with_index(1u8));
assert_eq!("x₅", x_with_index(5u64));
fn x_with_index<T: Integer>(index: T) -> String {
format!("x{}", Subscript(index))
}Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.