In Rust ownership you have a simple case where there is only ever one owner of a variable. However, there can be times where you need multiple owners to one value.
In Rust, you can enable multiple owners by using the Rc type. This stands for Reference Counting.
0:00 intro
1:07 Using Rc to Share Data
3:13 Cloning an Rc Increases the Reference Count
Rust: Reference Counted Smart Pointer
Теги
Rustrcpointerclonereference countingreference countdropboxfunctiondevicescheatshacksexplainedmismatchstringperformancecrateslangcommand lineprogrammingtutorialgetting startedbeginnerrustcrustfmtvscodemainswiftrequiredstaticspecifiersubtypingnamingboundscopeintegertupleover enumenumoverhashmapother traitotherselfnot satifiedmethodvariablesspecilizationmonomorphizationcannot be made into an objectreturnborrowchecker