title: What are the differences between a default Trait method and a parameterized function?
body: <p>In Rust, I tend to have design issues when it comes to writing modules with traits. I'm not always sure whether I want:</p>
  
  <pre><code>pub trait Foo {
      fn foo(&amp;self) -&gt; bool;
  
      fn bar(&amp;self) {
         if self.foo() {
             // Do something!
         } else {
             // Do something else!
         }
      }
  }
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>pub trait Foo {
      fn foo(&amp;self) -&gt; bool;
  }
  
  pub fn bar&lt;T&gt;(fooer: &amp;T) where T: Foo {
      if fooer.foo() {
          // Do something!
      } else {
          // Do something else!
      }
  }
  </code></pre>
  
  <p>(Of course, real examples are likely to have more elaborate traits or function signatures)</p>
  
  <p>While issues of design are beyond the scope of Stack Overflow, I'm not entirely sure I even understand the meaningful, objective differences between the two, and I don't feel like browsing the standard library has shed much light. It <strong>seems</strong> like Rust's standard library prefers to use <code>variable.method()</code> as opposed to <code>mod::function(&amp;variable)</code> in most cases. However, that still doesn't really answer the question since that's just a style guide argument rather than being based on objective knowledge about the difference.</p>
  
  <p>Other than the obvious syntactic difference, what are the main <strong>functional</strong> differences between a default trait method and a module-level parameterized function? One big question I have is: does the default trait method monomorphize to use static dispatch, or does if it take <code>self</code> as if it were a trait object?</p>
  
  <p>The only difference I'm seeing off the top of my head is that an <code>impl</code> of the trait may elect to override the default method implementation, hopefully/presumably providing an implementation that fulfills the same contract, while I'm guaranteed that the <code>mod::function</code> implementation always runs the exact same code no matter what (for better or worse). Is there anything else? Does the answer change if associated types or extension traits are involved?</p>