|
|
|
@ -71,6 +71,9 @@ impl_formatter_for_types!(
|
|
|
|
|
|
|
|
|
|
|
|
impl<const N: usize> LowerHexFormatter for &[u8; N] {}
|
|
|
|
impl<const N: usize> LowerHexFormatter for &[u8; N] {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
impl<T> LowerHexFormatter for *const T {}
|
|
|
|
|
|
|
|
impl<T> LowerHexFormatter for *mut T {}
|
|
|
|
|
|
|
|
|
|
|
|
pub trait UpperHexFormatter {}
|
|
|
|
pub trait UpperHexFormatter {}
|
|
|
|
impl_formatter_for_types!(
|
|
|
|
impl_formatter_for_types!(
|
|
|
|
UpperHexFormatter: {
|
|
|
|
UpperHexFormatter: {
|
|
|
|
@ -82,6 +85,9 @@ impl_formatter_for_types!(
|
|
|
|
|
|
|
|
|
|
|
|
impl<const N: usize> UpperHexFormatter for &[u8; N] {}
|
|
|
|
impl<const N: usize> UpperHexFormatter for &[u8; N] {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
impl<T> UpperHexFormatter for *const T {}
|
|
|
|
|
|
|
|
impl<T> UpperHexFormatter for *mut T {}
|
|
|
|
|
|
|
|
|
|
|
|
pub trait IpFormatter {}
|
|
|
|
pub trait IpFormatter {}
|
|
|
|
impl IpFormatter for IpAddr {}
|
|
|
|
impl IpFormatter for IpAddr {}
|
|
|
|
impl IpFormatter for Ipv4Addr {}
|
|
|
|
impl IpFormatter for Ipv4Addr {}
|
|
|
|
@ -144,6 +150,8 @@ pub enum ArgumentKind {
|
|
|
|
|
|
|
|
|
|
|
|
Bytes,
|
|
|
|
Bytes,
|
|
|
|
Str,
|
|
|
|
Str,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Pointer,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// All display hints
|
|
|
|
/// All display hints
|
|
|
|
@ -282,6 +290,20 @@ impl Argument for DisplayHint {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
impl<T> sealed::Sealed for *const T {}
|
|
|
|
|
|
|
|
impl<T> Argument for *const T {
|
|
|
|
|
|
|
|
fn as_argument(&self) -> (ArgumentKind, impl AsRef<[u8]>) {
|
|
|
|
|
|
|
|
(ArgumentKind::Pointer, (*self as usize).to_ne_bytes())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
impl<T> sealed::Sealed for *mut T {}
|
|
|
|
|
|
|
|
impl<T> Argument for *mut T {
|
|
|
|
|
|
|
|
fn as_argument(&self) -> (ArgumentKind, impl AsRef<[u8]>) {
|
|
|
|
|
|
|
|
(ArgumentKind::Pointer, (*self as usize).to_ne_bytes())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn wire_len(value: &[u8]) -> Option<[u8; 2]> {
|
|
|
|
fn wire_len(value: &[u8]) -> Option<[u8; 2]> {
|
|
|
|
match LogValueLength::try_from(value.len()) {
|
|
|
|
match LogValueLength::try_from(value.len()) {
|
|
|
|
Ok(wire_len) => Some(wire_len.to_ne_bytes()),
|
|
|
|
Ok(wire_len) => Some(wire_len.to_ne_bytes()),
|
|
|
|
|