Use [crate/module]::*all_the_traits*;

With use [crate]/module::PATTERN;

I see ways to:

  • pull in particular struct/enum/trait
  • group of strcut/enum/trait
  • submodule

However, I want to say "pull in all the traits"

The rationale for this is: for structs/enums, I prefer to write foo::BLAH , so I can see where it is coming from. However, for fns in traits defined via fn (&self, ...), I prefer to do x.BLAH without having to first pull in the trait BLAH is from.

Thus is there a way to say use [module/crate]::*precisely all the traits*; ?

[No, I don't have things organized in such a way where all the traits are nicely pkged in one submodule]

No

3 Likes

I get tempted to define a sort of "trait prelude" in crates I create for this sort of reason. But I don't think it's a commonly done thing

1 Like