Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

armanriazi•rust•interior-mutability•vs•inherited-mutability

We say that Cell<T> and RefCell<T> provide ‘interior mutability’, in contrast with typical Rust types that exhibit ‘inherited mutability’.
 the pattern uses unsafe code inside a data structure to bend Rust’s usual rules that govern mutation and borrowing.
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
7+5 =