Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

armanriazi•rust•interior-mutability•cell

For types that implement Copy, the get method retrieves the current interior value.
For types that implement Default, the take method replaces the current interior value with Default::default() and returns the replaced value.
For all types, the replace method replaces the current interior value and returns the replaced value and the into_inner method consumes the Cell<T> and returns the interior value. Additionally, the set method replaces the interior value, dropping the replaced value.
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
9+5 =