#[derive(DisplayAttr)]
{
// Attributes available to this derive:
#[fmt]
#[fmt_display]
}
Expand description
Derive macro for implementing std::fmt::Display.
§Attributes
#[fmt_display("...", args...)]- Format string specifically forDisplay(highest priority)#[fmt("...", args...)]- Shared format string for bothDisplayandDebug(fallback)
§Example
use format_attr::DisplayAttr;
#[derive(DisplayAttr)]
#[fmt("User: {}", self.name)]
struct User {
name: String,
}