While implementing a Trait method (lets say
method1) for a given type, I would like to split the code into multiple methods (it makes sense from the logic of the program). The natural way (to me at least) is to put all these helper functions into the same
impl block as they belong together with
method1. But this is not allowed and upon compilation I get:
error: method method1_helper is not a member of trait This Trait`
The only way to fix it seems to be:
- putting all the code in the type
- creating another trait
- using module functions.
None of them seem optimal, these functions really belong in the
impl block. Is there a way to do this?