If you've primarily used high level languages like Python, you may not be used to explicitly thinking about the ownership or representation of your values in memory.[^cache] In system languages like C++ or Rust, we have direct control over these aspects, and are able to use the type system to explicitly represent when a function takes ownership of a value, vs when it only takes a (temporary) reference.[^typing]
First, different types of ownership, in order of preference:
T t
. A normal owned value of type T, uniqlue owned. If declared as a variable it is stored on ...