| Crates.io | shapely-pretty |
| lib.rs | shapely-pretty |
| version | 3.1.0 |
| created_at | 2025-03-11 16:57:35.334991+00 |
| updated_at | 2025-03-31 19:08:13.447458+00 |
| description | Pretty-printing for types implementing the Shapely trait |
| homepage | https://github.com/bearcove/shapely |
| repository | https://github.com/bearcove/shapely |
| max_upload_size | |
| id | 1588192 |
| size | 40,543 |
A pretty-printing library for types implementing the Shapely trait, providing colorful and well-formatted output.
Shapely traituse shapely::Shapely;
use shapely_pretty::PrettyPrinter;
#[derive(Debug, Shapely)]
struct Person {
name: String,
age: u32,
address: Address,
}
#[derive(Debug, Shapely)]
struct Address {
street: String,
city: String,
country: String,
}
let person = Person {
name: "Alice".to_string(),
age: 30,
address: Address {
street: "123 Main St".to_string(),
city: "Wonderland".to_string(),
country: "Imagination".to_string(),
},
};
// Print with default settings
PrettyPrinter::new().print(&person);
// Customize the printer
PrettyPrinter::new()
.with_indent_size(4)
.with_max_depth(3)
.print(&person);
Thanks to Namespace for providing fast GitHub Actions workers:
Licensed under either of:
at your option.