title: How do I create a macro that takes a function with multiple parameters and supplies the first argument for that function?
body: <p>I want to be able to create a higher-order function (called <code>g</code>) that takes in a function (called <code>f</code>). <code>g</code> should pass in the first parameter to <code>f</code> and return a new function.</p>
  
  <p>The use case is that I want to initiate a database connection in <code>g</code> and pass it functions that accept a database connection. </p>
  
  <pre><code>fn f1(a: i32, b: String) -&gt; String {
      b
  }
  
  fn f2(a: i32, c: i64, d: i16) -&gt; i32 {
      1000
  }
  
  fn g&lt;T&gt;(f: fn(a: i32, arbitrary_arguments_type) -&gt; T) -&gt; fn(arbitrary_arguments_type) -&gt; T {
      move |arbitrary_arguments| f(1, arbitrary_arguments)
  }
  
  fn main() {
      g(f1)("hello".to_string());
      g(f2)(10, 11);
  }
  </code></pre>
  
  <p>How do I create a macro that takes in as an argument a function with a more than 1 parameter, where first parameter is of a certain type, and supplies that argument for that first function?</p>