#rust #refcell #interiormutability
Interior Mutability - Mutate the data even with immutable references to that data. The borrowing rules disallow this in Rust. RefCell follows this Interior Mutability Pattern.
0:00 intro
1:16 Enforcing Borrowing Rules at Runtime with RefCell
4:25 Interior Mutability: A Mutable Borrow to an Immutable Value
5:01 A Use Case for Interior Mutability: Mock Objects
9:04 Keeping Track of Borrows at Runtime with RefCell
16:55 Having Multiple Owners of Mutable Data by Combining Rc and RefCell
19:25 Outro
Links
Unsafe Rust
[ Ссылка ]
RefCell borrow_mut
[ Ссылка ]
RefMut implements Deref
[ Ссылка ]
Mutex
[ Ссылка ]
Rust: RefCell
Теги
Rustrefcellrefcell vs rcinterior mutabilityboxheaprcreference countingreference countdropfunctiondevicescheatshacksexplainedmismatchstringperformancecrateslangcommand lineprogrammingtutorialgetting startedbeginnerrustcrustfmtvscodemainswiftrequiredstaticspecifiersubtypingnamingboundscopeintegertupleover enumenumoverhashmapother traitotherselfmethodvariablesspecilizationmonomorphizationcannot be made into an objectborrowchecker