Tag: traits
-
prevent a trait function from being implemented by other struct
9 I just build a trait Bar with 2 functions (alpha() with implementation and beta() with only interfaces), and I hope the struct who implement Bar implements only beta(), and never implement their own alpha(). Is there any way to prevent another struct from implementing their own alpha()? trait Bar { fn alpha(&self) { println!("you…
-
How to use mixins in TypeGraphQL to replicate “traits” and extend types?
1 I am trying to replicate the idea of "traits" from PHP into TypeGraphQL types. However, between abstract classes and mixins, I got a bit lost and can’t figure out what even to google…. I would like to have a bunch of traits that I can add to my types to reduce the amount of…