Struct show_bytes::Printer
source · pub struct Printer { /* private fields */ }
Expand description
This prints the byte string, stylizing it based on its internal state.
Its main method is Printer::into_string
.
Implementations§
source§impl Printer
impl Printer
sourcepub fn with_single_quotes() -> Self
pub fn with_single_quotes() -> Self
Returns a new Printer wrapping its output in single quotes. It escapes any single quotes within the output.
sourcepub fn with_double_quotes() -> Self
pub fn with_double_quotes() -> Self
Returns a new Printer wrapping its output in double quotes. It escapes any double quotes within the output.
sourcepub fn write_to<I, W>(&self, writer: &mut W, bytes: I) -> Result<()>where
I: IntoIterator,
I::Item: Borrow<u8>,
W: Write,
pub fn write_to<I, W>(&self, writer: &mut W, bytes: I) -> Result<()>where I: IntoIterator, I::Item: Borrow<u8>, W: Write,
Writes the output to an arbitrary writer.
sourcepub fn into_string<I>(&self, bytes: I) -> Stringwhere
I: IntoIterator,
I::Item: Borrow<u8>,
pub fn into_string<I>(&self, bytes: I) -> Stringwhere I: IntoIterator, I::Item: Borrow<u8>,
Returns a string displaying the bytes.
Trait Implementations§
source§impl Ord for Printer
impl Ord for Printer
source§impl PartialEq<Printer> for Printer
impl PartialEq<Printer> for Printer
source§impl PartialOrd<Printer> for Printer
impl PartialOrd<Printer> for Printer
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Printer
impl Eq for Printer
impl StructuralEq for Printer
impl StructuralPartialEq for Printer
Auto Trait Implementations§
impl RefUnwindSafe for Printer
impl Send for Printer
impl Sync for Printer
impl Unpin for Printer
impl UnwindSafe for Printer
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