Is there a way to have private functions in public traits?
<p>I have an implementation for a public trait that repeats some work over multiple functions, so I'd like to DRY it up with a function that does the shared work, to be called from the functions actually meant to be used. So I have:</p>

<ul>
<li><code>fn do_private_thing()</code></li>
<li><code>fn do_pub_1()</code></li>
<li><code>fn do_pub_2()</code></li>
</ul>

<p>I don't want <code>do_private_thing()</code> to be exposed in docs or used directly, because it doesn't do anything useful from the perspective of a user of the trait/implementation. But functions in public traits are not private.</p>

<p>I could make <code>do_private_thing</code> a private function in the module where the trait implementation is located, but the trait does require that that function's work be done by any implementation of the trait. So I feel like I'm lying a little bit if I leave that code out of the implementation.</p>

<p>What's the reasonable way to lay this out in Rust?</p>