#tetcoin #debugging #framework #blockchain #crypto #derive-debug #macro-derive

macro no-std debug-derive

Tetcore macros to derive runtime debug implementation

Show the crate…

3 stable releases

2.1.2 Jun 23, 2021
2.0.2 Apr 3, 2021
2.0.1 Mar 8, 2021
0.0.0 Mar 8, 2021

#147 in #derive-debug

Download history 266/week @ 2023-12-23 95/week @ 2023-12-30 194/week @ 2024-01-06 239/week @ 2024-01-13 134/week @ 2024-01-20 96/week @ 2024-01-27 164/week @ 2024-02-03 164/week @ 2024-02-10 239/week @ 2024-02-17 159/week @ 2024-02-24 211/week @ 2024-03-02 288/week @ 2024-03-09 237/week @ 2024-03-16 377/week @ 2024-03-23 414/week @ 2024-03-30 167/week @ 2024-04-06

1,201 downloads per month
Used in 163 crates (3 directly)

Apache-2.0

10KB
184 lines

debug-derive

Macros to derive runtime debug implementation.

This custom derive implements a core::fmt::Debug trait, but in case the std feature is enabled the implementation will actually print out the structure as regular derive(Debug) would do. If std is disabled the implementation will be empty.

This behaviour is useful to prevent bloating the runtime WASM blob from unneeded code.

#[derive(debug_derive::RuntimeDebug)]
struct MyStruct;

assert_eq!(format!("{:?}", MyStruct), "MyStruct");

lib.rs:

Macros to derive runtime debug implementation.

This custom derive implements a core::fmt::Debug trait, but in case the std feature is enabled the implementation will actually print out the structure as regular derive(Debug) would do. If std is disabled the implementation will be empty.

This behaviour is useful to prevent bloating the runtime WASM blob from unneeded code.

#[derive(debug_derive::RuntimeDebug)]
   struct MyStruct;

   assert_eq!(format!("{:?}", MyStruct), "MyStruct");

Dependencies

~1.5MB
~33K SLoC