derive_more
                                
                                
                                
                                    derive_more copied to clipboard
                            
                            
                            
                        Some more derive(Trait) options
My case is that I want something equivalent to this: ```rust #[derive(Debug, Clone, Copy)] pub struct ReplacementParameter(Probability); impl From for f64 { fn from(value: ReplacementParameter) -> Self { value.0.into() }...
I'm finding myself needing to wrap a type "quickly", but then I don't want to have any specific restrictions on the inner-type, other than being wrapped. `PartialOrd` and `PartialEq` where...
I derive `derive_more::Add` for my struct, allowing me to add two owned values: ```rust #[derive(derive_more::Add)] struct MyStruct(i64); fn main() { let a = MyStruct(1); let b = MyStruct(2); let c...
Had to switch from using `AsRef` to using `Borrow` in a project of mine for certain reasons and I'd really like to continue using this crate for that purpose. `Borrow`...
The idea is to provide somewhat similar to [getset](https://docs.rs/getset) crate, but with a more consistent design and being more clever about generics. ## Motivation I use ["Parse, don't validate"](https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/) approach...
derive_more = "0.99.11" ```rust use derive_more::IntoIterator; #[derive(IntoIterator)] struct Numbers { #[into_iterator] numbers: Vec, _useless: std::marker::PhantomData, } fn main() { let nums = Numbers:: { numbers: vec![100, 200], _useless: std::marker::PhantomData, };...
```rust #[derive(From)] struct Example { main_field: u32, some_extra: bool, } ``` Currently, the code above produces `impl From`. There is no way, AFAIK, to make derive_more create an `impl From`...
Hey folks, Thanks for putting together this crate, it is very useful for implementing value objects. Is there a roadmap for the project? Are there specific contribution guidelines? Thanks!
C-like enums with an explicit `#[repr()]` attribute can be cast to that integer type, but there's no easy way to convert back: ```rust #[repr(i16)] enum MyEnum { Foo = 1,...
I really like this crate, and would love to see one crate that did _what you would expect_ for std traits. So I was thinking about compiling a list of...