use vts::vts; vts! { /// HexaString is a string where all the characters are /// valid hexadecimal characters. pub(self) type HexaString = String where self.chars().all(|c| c.is_ascii_hexdigit()); } fn main() { let hexa_string = HexaString::new("01AaB9".to_owned()).unwrap(); println!("hexa string: {:?}", *hexa_string); }