Name (derive-name)

CI Crate Docs

Derive macro to get name of type (struct/enum) as String.

Usage

```rust use derive_name::Name;

[derive(Name)]

struct MyStruct;

assert_eq!(MyStruct::name(), "MyStruct"); ```

Manual implementation

```rust use derive_name::Name;

struct MyStruct;

impl Name for MyStruct { fn name() -> &'static str { "Banana" } }

assert_eq!(MyStruct::name(), "Banana"); ```

Contributing

If you think you found a bug: open a issue. Feature request are also welcome.

License

This library is distributed under the terms of the ISC License.
Find an easy explanation on choosealicense.com/licenses/isc.