I have two ID types, both are Uuid:
type PersonId = Uuid;
type RoomId = Uuid;
And I have a function:
fn get_age(person: PersonId) -> u16 {
...
}
But I can call it with RoomId
or even with Uuid
. How can I restrict it to be callable with only exact PersonId
type?
Edit: newtype pattern is a good solution, but it looks me somewhat overhead