pub struct Bytes<'a>(pub &'a [u8]);Expand description
Lazy hex formatter - only formats when actually displayed.
This avoids allocation when logging at disabled levels.
§Examples
use async_snmp::format::hex::Bytes;
let data = [0xde, 0xad, 0xbe, 0xef];
let formatted = format!("{}", Bytes(&data));
assert_eq!(formatted, "deadbeef");Tuple Fields§
§0: &'a [u8]Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Bytes<'a>
impl<'a> RefUnwindSafe for Bytes<'a>
impl<'a> Send for Bytes<'a>
impl<'a> Sync for Bytes<'a>
impl<'a> Unpin for Bytes<'a>
impl<'a> UnwindSafe for Bytes<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more