Skip to main content

Crate deduct

Crate deduct 

Source
Expand description

§Procedural macros for Rust

This crate provides a collection of procedural macros to reduce boilerplate and enhance Rust’s code generation capabilities. Additional macros will be added as the crate evolves.

§Current macros

§DebugDisplay

Derive macro that implements core::fmt::Display by forwarding to the type’s Debug implementation. Useful when you want the {:?} output in {} contexts.

Note: The type must still implement Debug (e.g., via #[derive(Debug)]). This macro only generates the Display impl, not Debug itself.

§Example

use deduct::DebugDisplay;

#[derive(Debug, DebugDisplay)]
struct Vector(i32, i32, i32);

assert_eq!(format!("{}", Vector(1, 2, 3)), "Vector(1, 2, 3)");

§No‑std support

This crate is #![no_std] compatible – it only uses core::fmt and core::ops.

Derive Macros§

DebugDisplay