{"repo":"JelteF/derive_more","free":true,"listed":false,"github":"https://github.com/JelteF/derive_more","clone":"git clone https://github.com/JelteF/derive_more.git","description":"Some more derive(Trait) options","language":"Rust","stars":2130,"topics":["derive","macros","developer-tools","rust","trait","newtype"],"license":"MIT","category":"dev-tools","readme_excerpt":"derive more Rust has lots of builtin traits that are implemented for its basic types, such as Add , Not , From or Display . However, when wrapping these types inside your own structs or enums you lose the implementations of these traits and are required to recreate them. This is especially annoying when your own structures are very simple, such as when using the commonly advised newtype pattern (e.g. MyInt(i32) ). This library tries to remove these annoyances and the corresponding boilerplate code. It does this by allowing you to derive lots of commonly used traits for both structs and enums. Example code By using this library the following code just works: The derivable traits Below are all the traits that you can derive using this library. Some trait derivations are so similar that the further documentation will only show a single one of them. You can recognize these by the \"-like\" suffix in their name. The trait name before that will be the only one that is used throughout the further documentation. It is important to understand what code gets generated when using one of the derives from this crate. That is why the links below explain what code gets generated for a trait for each group from before. You can use the [ cargo-expand ] utility to see the exact code that is generated for your specific type. This will show you your code with all macros and derives expanded. NOTE : You still have to derive each trait separately. So #[derive(Mul)] doesn't automatically derive Div a","default_branch":null,"files":null,"tree":[],"storefront":"/r/JelteF","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/JelteF/derive_more/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}