Someone help me, a rust programmer , understand this: is this like having a function be generic over structs with some fields?
Like having `<T: {width: f64, depth: f64}>`?
I have such a hard time understanding the multiple arrows notation of ML family languages.
Yes! The idea is that we just care that it’s something with the named & typed fields. It can have more fields, but we’re really setting a lower bound on what we need to exist for our function to work.
Hmmm … my beginner’s rust is getting too rusty.
Is this valid rust (it’d be new to me)?!
If not, I’m guessing, from memory, the only way at this in rust is to through traits?