A newtype is a struct with a single field, struct Metres(f64);, that gives an existing type a new name and a new set of operations: those implemented for it, and no others.
Computer Science · Glossaire
Computer Science · Glossaire
A newtype is a struct with a single field, struct Metres(f64);, that gives an existing type a new name and a new set of operations: those implemented for it, and no others.