pub struct PrettyPrinter<'a, T: PrettyPrint> { /* private fields */ }
Expand description
Wrapper for using a PrettyPrint
where a Display
is expected.
Implementations§
Source§impl<'a, T: PrettyPrint> PrettyPrinter<'a, T>
impl<'a, T: PrettyPrint> PrettyPrinter<'a, T>
Sourcepub fn new(
prefix: &'static str,
buffer: &'a dyn AsRef<[u8]>,
) -> PrettyPrinter<'a, T>
pub fn new( prefix: &'static str, buffer: &'a dyn AsRef<[u8]>, ) -> PrettyPrinter<'a, T>
Format the listing with the recorded parameters when Display::fmt is called.
Source§impl<'a, T: PrettyPrint + AsRef<[u8]>> PrettyPrinter<'a, T>
impl<'a, T: PrettyPrint + AsRef<[u8]>> PrettyPrinter<'a, T>
Sourcepub fn print(printable: &'a T) -> PrettyPrinter<'a, T>
pub fn print(printable: &'a T) -> PrettyPrinter<'a, T>
Create a PrettyPrinter
which prints the given object.
Trait Implementations§
Source§impl<'a, T: PrettyPrint> Display for PrettyPrinter<'a, T>
impl<'a, T: PrettyPrint> Display for PrettyPrinter<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for PrettyPrinter<'a, T>
impl<'a, T> !RefUnwindSafe for PrettyPrinter<'a, T>
impl<'a, T> !Send for PrettyPrinter<'a, T>
impl<'a, T> !Sync for PrettyPrinter<'a, T>
impl<'a, T> Unpin for PrettyPrinter<'a, T>where
T: Unpin,
impl<'a, T> !UnwindSafe for PrettyPrinter<'a, T>
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more