Relative Content

Tag Archive for genericsrust

Is there a way to define a generic type generically?

If I want to implement a struct with a certain generic type that requires alot of traits, like below. I then have to copy this to every time i implement a trait for this struct (where it needs the same type) is there a shorthand way to do this? I am imagining something like generic T = Add + ... + PartialEq

Is there a way to define a generic type generically?

If I want to implement a struct with a certain generic type that requires alot of traits, like below. I then have to copy this to every time i implement a trait for this struct (where it needs the same type) is there a shorthand way to do this? I am imagining something like generic T = Add + ... + PartialEq

Is there a way to define a generic type generically?

If I want to implement a struct with a certain generic type that requires alot of traits, like below. I then have to copy this to every time i implement a trait for this struct (where it needs the same type) is there a shorthand way to do this? I am imagining something like generic T = Add + ... + PartialEq