What is the difference between Rc<RefCell<T>> and RefCell<Rc<T>>?
问题 The Rust documentation covers Rc<RefCell<T>> pretty extensively but doesn't go into RefCell<Rc<T>> , which I am now encountering. Do these effectively give the same result? Is there an important difference between them? 回答1: Do these effectively give the same result? They are very different. Rc is a pointer with shared ownership while RefCell provides interior mutability. The order in which they are composed makes a big difference to how they can be used. Usually, you compose them as Rc