title: How can I avoid a function name clash while implementing a trait?
body: <p>I have a struct with an implementation that has a function which accesses the private state of the struct.</p>
  
  <pre><code>struct Example {...}
  
  impl Example {
      fn test(&amp;self) -&gt; .. {...}
  }
  </code></pre>
  
  <p>Somewhere else in another module there exists another trait:</p>
  
  <pre><code>trait ExampleTrait {
      fn test(&amp;self) -&gt; .. {...}
  }
  </code></pre>
  
  <p>Now I would like to implement <code>ExampleTrait</code> for the <code>Example</code> struct and to forward the test method to the test <code>impl</code> for the struct.</p>
  
  <p>The following code:</p>
  
  <pre><code>impl ExampleTrait for Example {
      fn test(&amp;self) -&gt; .. {
          self.test()
      }
  }
  </code></pre>
  
  <p>Is obviously an infinite recursive call. I cannot just repeat the body of the original test as I do not have access to the private state of <code>Example</code> here.</p>
  
  <p>Is there another way to do this except for renaming one function or making fields in <code>Example</code> public?</p>