Expand description
This crate allows the user to format many data structures in ways that look nicer to the end-user.
The Wikipedia page on Box-Drawing Characters has been quite helpful
Currently, we support:
slice
s withBorderFormatter::format_slice
Iterator
s withBorderFormatter::format_iter
HashMap
s withBorderFormatter::format_hash_map
- impl
Display
withBorderFormatter::format_display
- impl
Debug
withBorderFormatter::format_debug
§Usage Example
use borderrs::{styles::THIN, BorderFormatter};
let slice = [0, 1, 2, 3, 4];
println!("{}", THIN.format_slice(&slice));
let mut map = HashMap::default();
map.insert("Jon", 38);
map.insert("Jake", 25);
map.insert("Josh", 17);
println!("{}", THIN.format_hash_map(&map));
println!("{}", THIN.format_display("hello"));
println!("{}", THIN.format_debug("hello"));
Modules§
- styles
- This module hosts the built-in styles.
Structs§
- Simple
Border Style - Represents a simple border style where all lines use the same format (determined by the values in the struct)
Traits§
- Border
Formatter - Used to control the formatting for each type of BorderStyle