Attribute Macro powerfmt::smart_display::private_metadata
source · #[private_metadata]
Available on crate feature
macros
only.Expand description
Declare a private metadata type for SmartDisplay
.
Use this attribute if you want to provide metadata for a type that is not public. Doing this will avoid a compiler error about a private type being used publicly. Keep in mind that any public fields, public methods, and trait implementations will be able to be used by downstream users.
To avoid accidentally exposing details, such as when all fields are public or if the type
is a unit struct, the type is annotated with #[non_exhaustive]
automatically.
/// Metadata for `Foo`
#[smart_display::private_metadata]
#[derive(Debug)]
pub(crate) struct FooMetadata {
pub(crate) expensive_to_calculate: usize,
}
The #[smart_display::private_metadata]
attribute.