pub struct Pretty<'a, T: Debug + ?Sized> { /* private fields */ }Expand description
Pretty-printing widget that renders a Debug representation.
Wraps any Debug value and renders it line-by-line into a frame,
using either compact ({:?}) or pretty ({:#?}) formatting.
Implementations§
Source§impl<'a, T: Debug + ?Sized> Pretty<'a, T>
impl<'a, T: Debug + ?Sized> Pretty<'a, T>
Sourcepub fn with_compact(self, compact: bool) -> Self
pub fn with_compact(self, compact: bool) -> Self
Use compact formatting ({:?}) instead of pretty ({:#?}).
Sourcepub fn with_style(self, style: Style) -> Self
pub fn with_style(self, style: Style) -> Self
Set the text style.
Sourcepub fn formatted_text(&self) -> String
pub fn formatted_text(&self) -> String
Get the formatted text as a string.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for Pretty<'a, T>where
T: ?Sized,
impl<'a, T> RefUnwindSafe for Pretty<'a, T>where
T: RefUnwindSafe + ?Sized,
impl<'a, T> Send for Pretty<'a, T>
impl<'a, T> Sync for Pretty<'a, T>
impl<'a, T> Unpin for Pretty<'a, T>where
T: ?Sized,
impl<'a, T> UnwindSafe for Pretty<'a, T>where
T: RefUnwindSafe + ?Sized,
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