|
|
@ -43,7 +43,6 @@ macro_rules! impl_formatter_for_types {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Any value impl `ToString`
|
|
|
|
|
|
|
|
pub trait DefaultFormatter {}
|
|
|
|
pub trait DefaultFormatter {}
|
|
|
|
impl_formatter_for_types!(
|
|
|
|
impl_formatter_for_types!(
|
|
|
|
DefaultFormatter: {
|
|
|
|
DefaultFormatter: {
|
|
|
@ -61,24 +60,20 @@ pub trait LowerHexFormatter {}
|
|
|
|
impl_formatter_for_types!(
|
|
|
|
impl_formatter_for_types!(
|
|
|
|
LowerHexFormatter: {
|
|
|
|
LowerHexFormatter: {
|
|
|
|
i8, i16, i32, i64, isize,
|
|
|
|
i8, i16, i32, i64, isize,
|
|
|
|
u8, u16, u32, u64, usize
|
|
|
|
u8, u16, u32, u64, usize,
|
|
|
|
|
|
|
|
&[u8]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
pub trait LowerHexDebugFormatter {}
|
|
|
|
|
|
|
|
impl LowerHexDebugFormatter for &[u8] {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub trait UpperHexFormatter {}
|
|
|
|
pub trait UpperHexFormatter {}
|
|
|
|
impl_formatter_for_types!(
|
|
|
|
impl_formatter_for_types!(
|
|
|
|
UpperHexFormatter: {
|
|
|
|
UpperHexFormatter: {
|
|
|
|
i8, i16, i32, i64, isize,
|
|
|
|
i8, i16, i32, i64, isize,
|
|
|
|
u8, u16, u32, u64, usize
|
|
|
|
u8, u16, u32, u64, usize,
|
|
|
|
|
|
|
|
&[u8]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
pub trait UpperHexDebugFormatter {}
|
|
|
|
|
|
|
|
impl UpperHexDebugFormatter for &[u8] {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub trait Ipv4Formatter {}
|
|
|
|
pub trait Ipv4Formatter {}
|
|
|
|
impl Ipv4Formatter for u32 {}
|
|
|
|
impl Ipv4Formatter for u32 {}
|
|
|
|
|
|
|
|
|
|
|
@ -97,12 +92,8 @@ pub fn check_impl_default<T: DefaultFormatter>(_v: T) {}
|
|
|
|
#[inline(always)]
|
|
|
|
#[inline(always)]
|
|
|
|
pub fn check_impl_lower_hex<T: LowerHexFormatter>(_v: T) {}
|
|
|
|
pub fn check_impl_lower_hex<T: LowerHexFormatter>(_v: T) {}
|
|
|
|
#[inline(always)]
|
|
|
|
#[inline(always)]
|
|
|
|
pub fn check_impl_lower_hex_debug<T: LowerHexDebugFormatter>(_v: T) {}
|
|
|
|
|
|
|
|
#[inline(always)]
|
|
|
|
|
|
|
|
pub fn check_impl_upper_hex<T: UpperHexFormatter>(_v: T) {}
|
|
|
|
pub fn check_impl_upper_hex<T: UpperHexFormatter>(_v: T) {}
|
|
|
|
#[inline(always)]
|
|
|
|
#[inline(always)]
|
|
|
|
pub fn check_impl_upper_hex_debug<T: UpperHexDebugFormatter>(_v: T) {}
|
|
|
|
|
|
|
|
#[inline(always)]
|
|
|
|
|
|
|
|
pub fn check_impl_ipv4<T: Ipv4Formatter>(_v: T) {}
|
|
|
|
pub fn check_impl_ipv4<T: Ipv4Formatter>(_v: T) {}
|
|
|
|
#[inline(always)]
|
|
|
|
#[inline(always)]
|
|
|
|
pub fn check_impl_ipv6<T: Ipv6Formatter>(_v: T) {}
|
|
|
|
pub fn check_impl_ipv6<T: Ipv6Formatter>(_v: T) {}
|
|
|
|