#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

#155 in #derive-debug

Download history 216/week @ 2024-05-21 226/week @ 2024-05-28 199/week @ 2024-06-04 139/week @ 2024-06-11 292/week @ 2024-06-18 196/week @ 2024-06-25 9/week @ 2024-07-02 200/week @ 2024-07-09 243/week @ 2024-07-16 172/week @ 2024-07-23 232/week @ 2024-07-30 168/week @ 2024-08-06 160/week @ 2024-08-13 150/week @ 2024-08-20 254/week @ 2024-08-27 133/week @ 2024-09-03

701 downloads per month
Used in 162 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
~36K SLoC