macro_rules! impl_basic {
($s:ident, $name:expr) => { ... };
}
Expand description
Defines a macro for creating structures with basic functionality.
This macro generates a structure that includes a single usize
field, implements several traits, and provides methods related to configuration and naming.
For any given identifier and a name, the generated structure derives traits for debugging, cloning, copying, equality comparison, and hashing.
It includes a method to create an instance from a configuration, specifically fetching a “cost” value, defaulting to 1 if unspecified.
There’s also a method for obtaining the name of the structure as a static string.
Additionally, it implements the Display
trait for formatted output of the structure’s name, and provides a default implementation that creates an instance using a default configuration.