#[repr(transparent)]pub struct BytesDisplay<'src>(pub &'src [u8]);Expand description
Renders a byte slice as text for diagnostic messages.
Valid UTF-8 is shown verbatim; bytes that are not valid UTF-8 are escaped as \xHH.
Use this in format!/write!/println! whenever a &[u8] needs to surface in
user-facing output (issue messages, log lines, error reports).
Tuple Fields§
§0: &'src [u8]Trait Implementations§
Source§impl<'src> Clone for BytesDisplay<'src>
impl<'src> Clone for BytesDisplay<'src>
Source§fn clone(&self) -> BytesDisplay<'src>
fn clone(&self) -> BytesDisplay<'src>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'src> Copy for BytesDisplay<'src>
Source§impl<'src> Debug for BytesDisplay<'src>
impl<'src> Debug for BytesDisplay<'src>
Auto Trait Implementations§
impl<'src> Freeze for BytesDisplay<'src>
impl<'src> RefUnwindSafe for BytesDisplay<'src>
impl<'src> Send for BytesDisplay<'src>
impl<'src> Sync for BytesDisplay<'src>
impl<'src> Unpin for BytesDisplay<'src>
impl<'src> UnsafeUnpin for BytesDisplay<'src>
impl<'src> UnwindSafe for BytesDisplay<'src>
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