Maybe Rust makes newtypes _easy_, but certainly C supports similar idioms by way of wrapping data in a unique struct.
Re:Would Rust Secure Curl?
by steveklabnik on Sunday January 17, 2021 @12:57AM
(#25808536)
The only significant difference is that you have to give the inner value a name in C, but you don't in Rust. It's a pretty marginal advantage.
An example of where I've recently done something like this is my sparse linear algebra code. I have distinct types for column and row vectors for a matrix, so that if I want to right-multiply A with a vector, the input has to be a column vector and the output has to be a row vector. Similarly, if I want to left-multiply A with a vector, the input has to be a row vector and the output has to be a column vector.