pub struct Pretty { /* private fields */ }Expand description
Configuration for vergen environment variable pretty printing
Build this with Pretty
§Display
let mut stdout = vec![];
Pretty::builder()
.env(vergen_pretty_env!())
.build()
.display(&mut stdout)?;§Trace
Generate tracing output
Pretty::builder()
.env(vergen_pretty_env!())
.build()
.trace();§Output a prefix/suffix
Prefix and Suffix also have configurable styles if you enable
the color feature
const TEST_PREFIX: &str = r#"A wonderful introduction
"#;
const TEST_SUFFIX: &str = r#"An outro"#;
let mut stdout = vec![];
let prefix = Prefix::builder()
.lines(TEST_PREFIX.lines().map(str::to_string).collect())
.build();
let suffix = Suffix::builder()
.lines(TEST_SUFFIX.lines().map(str::to_string).collect())
.build();
Pretty::builder()
.env(vergen_pretty_env!())
.prefix(prefix)
.suffix(suffix)
.build()
.display(&mut stdout)?;§Customize Colorized Output
Uses Style to colorize output
let mut stdout = vec![];
let red_bold = Style::new().bold().red();
let yellow_bold = Style::new().bold().yellow();
Pretty::builder()
.env(vergen_pretty_env!())
.key_style(red_bold)
.value_style(yellow_bold)
.build()
.display(&mut stdout)?;Implementations§
Trait Implementations§
impl StructuralPartialEq for Pretty
Auto Trait Implementations§
impl Freeze for Pretty
impl RefUnwindSafe for Pretty
impl Send for Pretty
impl Sync for Pretty
impl Unpin for Pretty
impl UnsafeUnpin for Pretty
impl UnwindSafe for Pretty
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.