helgoboss_midi/
u4_mod.rs

1// Basic newtype definition
2newtype! {
3    #[doc = r"A 4-bit integer (0 - 15)."]
4    name = U4, repr = u8, max = 15
5}
6
7// From lower newtypes to this newtype
8// -
9
10// From lower primitives to this newtype
11// -
12
13// From this newtype to higher primitives
14impl_from_newtype_to_primitive!(U4, u8);
15impl_from_newtype_to_primitive!(U4, i8);
16impl_from_newtype_to_primitive!(U4, u16);
17impl_from_newtype_to_primitive!(U4, i16);
18impl_from_newtype_to_primitive!(U4, u32);
19impl_from_newtype_to_primitive!(U4, i32);
20impl_from_newtype_to_primitive!(U4, u64);
21impl_from_newtype_to_primitive!(U4, i64);
22impl_from_newtype_to_primitive!(U4, u128);
23impl_from_newtype_to_primitive!(U4, i128);
24impl_from_newtype_to_primitive!(U4, usize);
25impl_from_newtype_to_primitive!(U4, isize);
26
27// TryFrom higher newtypes to this newtype
28impl_try_from_newtype_to_newtype!(crate::U14, U4);
29impl_try_from_newtype_to_newtype!(crate::U7, U4);
30
31// TryFrom higher primitives to this newtype
32impl_try_from_primitive_to_newtype!(u8, U4);
33impl_try_from_primitive_to_newtype!(u16, U4);
34impl_try_from_primitive_to_newtype!(i16, U4);
35impl_try_from_primitive_to_newtype!(u32, U4);
36impl_try_from_primitive_to_newtype!(i32, U4);
37impl_try_from_primitive_to_newtype!(u64, U4);
38impl_try_from_primitive_to_newtype!(i64, U4);
39impl_try_from_primitive_to_newtype!(u128, U4);
40impl_try_from_primitive_to_newtype!(i128, U4);
41impl_try_from_primitive_to_newtype!(usize, U4);
42impl_try_from_primitive_to_newtype!(isize, U4);