title: How to create a Rc<RefCell<>> of a self mutable reference?
body: <p>I'm implementing a trait for <code>VirtualTapInterface</code>. The <code>receive</code> function of this trait should create a <code>TxToken</code> struct, where the <code>lower</code> property must be an <code>Rc&lt;RefCell&lt;VirtualTapInterface&gt;&gt;</code> containing the current <code>VirtualTapInterface</code>, that is <code>self</code></p>
  
  <pre><code>impl&lt;'a&gt; Device&lt;'a&gt; for VirtualTapInterface {
      type TxToken = TxToken;
  
      fn receive(&amp;'a mut self) -&gt; Option&lt;(Self::RxToken, Self::TxToken)&gt; {
                  let tx = TxToken { lower: Rc::new(RefCell::new(*self))};
  </code></pre>
  
  <p>I tried this but I get that </p>
  
  <blockquote>
    <p>cannot move out of <code>*self</code> which is behind a mutable reference</p>
    
    <p>move occurs because <code>*self</code> has type
    <code>phy::virtual_tun::VirtualTapInterface</code>, which does not implement the
    <code>Copy</code> traitrustc(E0507)</p>
  </blockquote>
  
  <p>How is it possible to create a <code>Rc&lt;RefCell&lt;&gt;&gt;</code> of a self mutable reference?</p>