title: Can a trait be passed as a Fn reference or closure
body: <p>In rust, you can take in a reference to a <code>Fn</code> as <a href="https://doc.rust-lang.org/book/closures.html#taking-closures-as-arguments" rel="nofollow">documented</a>:</p>
  
  <pre><code>fn call_with_one(some_closure: &amp;Fn(i32) -&gt; i32) -&gt; i32 {
      some_closure(1)
  }
  let answer = call_with_one(&amp;|x| x + 2);
  </code></pre>
  
  <p>However I want to write a trait that, if implemented, the Runnable can be passed to anything that expects a <code>Fn()</code>. Is this possible?</p>
  
  <pre><code>trait Runnable {
      fn run(&amp;self);
  }
  
  struct MyRunnable;
  impl Runnable for MyRunnable {
      fn run(&amp;self) {}
  }
  
  struct StructThatTakesClosure&lt;'life&gt; {
      closure_field: &amp;'life Fn(),
  }
  
  fn main() {
      // is there a way to change the Runnable trait to automatically match the
      // Fn() interface such that the MyRunnable instance can be passed directly?
      StructThatTakesClosure { closure_field: &amp;|| MyRunnable.run() };
  }
  </code></pre>
  
  <p>I have tried implementing the 3 normally <code>extern</code> calls as default functions but I didn't manage to get it working.</p>