Crate facet_pretty

Crate facet_pretty 

Source
Expand description

§facet-pretty

Coverage Status crates.io documentation MIT/Apache-2.0 licensed Discord

Provides pretty-printing capabilities for Facet types.

§Sponsors

Thanks to all individual sponsors:

GitHub Sponsors Patreon

…along with corporate sponsors:

AWS Zed Depot

…without whom this work could not exist.

§Special thanks

The facet logo was drawn by Misiasart.

§License

Licensed under either of:

at your option.

Modules§

colors
Tokyo Night color scheme for syntax highlighting
tokyo_night
Tokyo Night color palette (RGB values from official theme)

Structs§

ColorGenerator
A color generator that produces unique colors based on a hash value
FieldSpan
Spans for a field or variant, tracking both key (name) and value (type) positions
FormattedShape
Result of formatting a shape with span tracking
FormattedValue
Result of formatting a value with span tracking
PrettyDisplay
Display wrapper for any type that implements Facet
PrettyPrinter
A formatter for pretty-printing Facet types
RGB
RGB color representation
ShapeFormatConfig
Configuration options for shape formatting

Enums§

PathSegment
A segment in a path through a type structure

Traits§

FacetPretty
Extension trait for Facet types to easily pretty-print them

Functions§

format_shape
Format a Shape as Rust-like source code (plain text, no colors)
format_shape_colored
Format a Shape as Rust-like source code with ANSI colors (Tokyo Night theme)
format_shape_colored_into
Format a Shape with ANSI colors into an existing String
format_shape_colored_into_with_config
Format a Shape with ANSI colors into an existing String with config options
format_shape_colored_with_config
Format a Shape as Rust-like source code with ANSI colors and config options
format_shape_with_config
Format a Shape as Rust-like source code with config options (plain text, no colors)
format_shape_with_spans
Format a Shape with span tracking for each field/variant Note: spans are computed on the plain text (no ANSI codes)
strip_ansi
Strip ANSI escape codes from a string

Type Aliases§

Path
A path to a location within a type structure
Span
A byte span in formatted output (start, end)