title: Understanding usage of Rc<RefCell<SomeStruct>> in Rust
body: <p>I'm looking at some code that uses</p>
  
  <pre><code>Rc&lt;RefCell&lt;SomeStruct&gt;&gt;
  </code></pre>
  
  <p>So I went out to read about the differentes between Rc and RefCell:</p>
  
  <p>Here is a recap of the reasons to choose Box, Rc, or RefCell:</p>
  
  <blockquote>
    <p>Rc enables multiple owners of the same data; Box and RefCell
    have single owners. </p>
    
    <p>Box allows immutable or mutable borrows checked
    at compile time; Rc allows only immutable borrows checked at
    compile time; </p>
    
    <p>RefCell allows immutable or mutable borrows checked
    at runtime. Because RefCell allows mutable borrows checked at
    runtime, you can mutate the value inside the RefCell even when the
    RefCell is immutable.</p>
  </blockquote>
  
  <p>So, <code>Rc</code> makes sure that <code>SomeStruct</code> is accessible by many people at the same time. But how do I access? I only see the <code>get_mut</code> method, which returns a mutable reference. But the text explained that "Rc allows only immutable borrows".</p>
  
  <p>If it's possible to access Rc's object in mut and not mut way, why a RefCell is needed?</p>