Expand description
§racros
Racros is a collection of rust macros.
§AutoDebug
Works on structs and enums, similar to std::fmt::Debug but support some customization:
- Specify field name or value in print message.
- Ignore specified field.
- Use
std::fmt::Displayinstead ofstd::fmt::Debugon specified field. - Set print style similar to printing tuple or struct.
§AutoStr
Implement TryFrom String and ToString for enums with following features:
- Specify what
Stringvalue can convert from/to. - Allow convert from multiple
Stringvalues. - Set default convert style:
lowercase,UPPERCASE,camelCase,PascalCaseandsnake_case.
§CopyWith
Add a copy_with function for decorated type, copy value from another Self if that value is
not default value.
§BundleText
Bundle text content or command output into static str at compile time and use in runtime.
Derive Macros§
- Auto
Debug - Generate debug trait implementation for structs and enums with control.
- AutoStr
- Automatically add
TryFromStringandToStringtrait to the attached enum. - Bundle
Text - Bundle text contents and command outputs into static str and use in runtime.
- Copy
With - Add a
copy_withfunction for decorated type, copy value from anotherSelfif that value is notdefaultvalue.