title: How to get raw pointer of box without consuming it?
body: <p>I need to pass a raw pointer to a struct to C++ and then still want to use that box afterwards.</p>
  <p>I found the <a href="https://doc.rust-lang.org/std/boxed/struct.Box.html#method.into_raw" rel="noreferrer">into_raw</a> function but it eats the box and I can't use that box any more in Rust. Is there a way to get a <code>*const T</code>? I could get away with <code>const_cast</code> on C++ side.</p>
  <p>This is what I'm trying to do:</p>
  <pre class="lang-rust prettyprint-override"><code>let handle_ptr = Box::&lt;Handle&gt;::into_raw(handle);            
       
       
  std::thread::spawn(move || {            
      let rt = tokio::runtime::Builder::new_current_thread()            
          .build()            
          .unwrap();             
       
      rt.block_on( handle.run() );            
  });            
       
  return handle_ptr
  </code></pre>
  <p>I know that this is unsafe but I don't know any other way to allow C++ code running on other thread to call a thread-safe method of a Rust object.</p>