title: I am getting a rust compile error with lifetimes
body: <p>I am trying to get some rust code to compile, but I keep getting errors about types and lifetimes. Can anyone explain what I am doing wrong?</p>
  
  <p>I am getting an error in the compile: <code>associated type bindings must be declared after generic parameters</code>. I have tried, I think, all combinations of parameters and none of them seem to work.</p>
  
  <p>Here is a simplified version of my code.</p>
  
  <pre class="lang-rust prettyprint-override"><code>/*! test of lifetimes for compile */
  extern crate web_view;
  use web_view::*;
  struct UserData {}
  
  type TestResult = WVResult&lt;i64&gt;;
  type TestView = WebView&lt;UserData&gt;;
  type TestBuilder&lt;'a&gt; = WebViewBuilder&lt; UserData: 'a,'a, 
           FnMut(&amp;mut TestView, &amp;str) -&gt; TestResult, String&gt;; // compile error
  
  fn main() {
      let mut p = UserData {};
      let wvb: TestBuilder = WebViewBuilder::new();
      let mut webview: TestView = wvb
          .title("Progress")
          .content("hello")
          .size(640, 960)
          .resizable(true)
          .debug(false)
          .user_data(p)
          .invoke_handler(handler)
          .build()
          .unwrap();
      let _res = webview.run().unwrap();
  }
  fn handler(webview: &amp;mut TestView, arg: &amp;str) -&gt; TestResult {
      Ok(1)
  }
  </code></pre>
  
  <p><em>This should be a comment, but it is too long to fit in a comment. I've used @zizka's answer, but restored my original version of TestResult. Now I am getting errors that "function or associated item not found" and "no method named <code>title</code> found for type"</em></p>
  
  <pre class="lang-rust prettyprint-override"><code>use web_view::*;
  
  struct UserData {}
  
  type TestResult = WVResult&lt;i64&gt;;
  type TestView&lt;'a&gt; = WebView&lt;'a, UserData&gt;;
  type TestBuilder&lt;'a&gt; =
      WebViewBuilder&lt;'a, UserData, fn(&amp;mut TestView, &amp;str) -&gt; TestResult, &amp;'static str&gt;;
  
  fn main() {
      let p = UserData {};
  
      let builder: TestBuilder = TestBuilder::new(); // error here
      let webview = builder
          .title("Progress") // error here
          .content(Content::Url("https://en.m.wikipedia.org/wiki/Main_Page"))
          .size(640, 960)
          .resizable(true)
          .debug(false)
          .user_data(p)
          .invoke_handler(handler)
          .build()
          .unwrap();
      webview.run().unwrap();
  }
  
  fn handler(_webview: &amp;mut TestView, _arg: &amp;str) -&gt; TestResult {
      Ok(17 as i64)
  }
  </code></pre>