docs.rs failed to build text_table-0.0.4
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
text_table.rs
Text Table is a library to create formatted plain-text tables from arbitrary data.
NOTE: The API is currently completely unstable, and it will change as I use this library in other projects. Feedback highly appreciated via the issues page or email.
Usage
Add text_table
to your Cargo.toml
:
[]
= "*"
Example
Basic Example
extern crate text_table;
use text_table::Table;
fn main() {
let mut table = Table::new();
table.row(("ID", "First Name", "Last Name", "Phone Number"))
.sep()
.row((1u, "Tammy", "Bailey", "496-914-5526"))
.row((2u, "Kathy", "Reynolds", "092-281-4890"))
.row((3u, "Edward", "Ramirez", "940-289-6874"))
.row((4u, "Robert", "Payne", "295-850-6147"))
.row((5u, "Roy", "Larson", "133-661-1680"));
println!("{}", table.write_to_string());
}
prints
+----+------------+-----------+--------------+
| ID | First Name | Last Name | Phone Number |
+----+------------+-----------+--------------+
| 1 | Tammy | Bailey | 496-914-5526 |
| 2 | Kathy | Reynolds | 092-281-4890 |
| 3 | Edward | Ramirez | 940-289-6874 |
| 4 | Robert | Payne | 295-850-6147 |
| 5 | Roy | Larson | 133-661-1680 |
+----+------------+-----------+--------------+
License
MIT