pub struct Display<T>{ /* private fields */ }Available on crate feature
alloc only.Expand description
A wrapper for displaying a byte slice as a hexadecimal string.
let bytes = &[0xde, 0xad, 0xbe, 0xef];
let displayed = fashex::Display::from(bytes);
assert_eq!(format!("{}", &displayed), "deadbeef");
assert_eq!(format!("{:X}", &displayed), "DEADBEEF");
assert_eq!(format!("{:#x}", &displayed), "0xdeadbeef");
assert_eq!(format!("{:#X}", &displayed), "0xDEADBEEF");Implementations§
Trait Implementations§
Source§impl<T> BorrowMut<T> for Display<T>
impl<T> BorrowMut<T> for Display<T>
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Copy for Display<T>
impl<T> Eq for Display<T>
impl<T> StructuralPartialEq for Display<T>
Auto Trait Implementations§
impl<T> Freeze for Display<T>where
T: Freeze,
impl<T> RefUnwindSafe for Display<T>where
T: RefUnwindSafe,
impl<T> Send for Display<T>where
T: Send,
impl<T> Sync for Display<T>where
T: Sync,
impl<T> Unpin for Display<T>where
T: Unpin,
impl<T> UnsafeUnpin for Display<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Display<T>where
T: UnwindSafe,
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