title: What is the Rust equivalent of TypeScript's Array.map with destructuring?
body: <p>In TypeScript, you can map and destructure a partial set of data from an interface, using the following</p>
  
  <pre class="lang-js prettyprint-override"><code>interface Person {
    name: string;
    address: string;
  }
  
  function getName({ name }: Person): Partial&lt;Person&gt; {
    return ({ name });
  }
  
  const people: Person[] = [
    {
      name: "Sally",
      address: "1234 E Test St."
    },
    // ...
  ];
  
  const names = people.map(getName);
  // =&gt; [{ "name": "Sally" }, ...]
  </code></pre>
  
  <p>I've been reading the Rust docs and maybe I'm just not understanding, but I haven't found a 1:1 equivalent on how to do this TypeScript operation in Rust. Is it possible to perform this type of destructure in Rust? Perhaps using <code>map</code> or <code>filter_map</code>?</p>