#format #cli #table #struct-table

macro structable_derive

Derive macros for the StructTable trait (structable crate)

14 releases

0.3.4 Aug 11, 2025
0.3.3 May 27, 2025
0.3.1 Apr 22, 2025
0.1.6 Mar 30, 2025
0.1.3 Mar 15, 2024

#194 in #table

Download history 125/week @ 2025-07-28 107/week @ 2025-08-04 279/week @ 2025-08-11 86/week @ 2025-08-18 205/week @ 2025-08-25 354/week @ 2025-09-01 412/week @ 2025-09-08 318/week @ 2025-09-15 357/week @ 2025-09-22 134/week @ 2025-09-29 869/week @ 2025-10-06 411/week @ 2025-10-13 313/week @ 2025-10-20 349/week @ 2025-10-27 185/week @ 2025-11-03 689/week @ 2025-11-10

1,547 downloads per month
Used in 4 crates (via structable)

Apache-2.0

19KB
261 lines

StructTable derive macro

Most likely you do not want to use this crate directly. It is a helper for the OpenStack

This crate implements derive macros for converting structures (or structure vectors) as tables (vector of vector of strings - as rows and columns).

use structable_derive::StructTable;
#[derive(Serialize, StructTable)]
struct User {
    #[structable(title = "ID")]
    id: u64,
    first_name: &'static str,
    last_name: &'static str,
    #[structable(title = "Long(only in wide mode)", wide)]
    extra: &'static str,
    #[structable(optional, pretty)]
    complex_data: Option<Value>
}

Dependencies

~0.5–1MB
~22K SLoC