title: How do I call a function that requires a 'static lifetime with a variable created in main?
body: <p>I've got a struct defined that has a function which defines a static lifetime:</p>
  
  <pre><code>impl MyStruct {
      pub fn doSomething(&amp;'static self) {
          // Some code goes here
      }
  }
  </code></pre>
  
  <p>I'm consuming it from main like so:</p>
  
  <pre><code>fn main() {
      let obj = MyStruct {};
      obj.doSomething();
  }
  </code></pre>
  
  <p>It's intended for the <code>doSomething</code> call to block and execute for the lifetime of the application.</p>
  
  <p>I'm running into issues with the lifetime checks where it's stating that it may outlive the <code>main</code> function, which seems strange to me as once <code>main</code> is complete the application should exit.</p>
  
  <p>Is there a way to achieve this?</p>