So, first, hold-up. I was very specific in my initial example to use private functions: the majority of time that I hit this problem, it concerns internal details of a type. Basically, I would prefer to have some helper functions, but I cannot, because the borrow checker doesn’t let me. This – the private function case – is I think a distinct use case worth considering separately when it comes to ergonomics (maybe not the underlying mechanism).
I find that when I am working with types “externally”, as in your example, it is much more unusual for me to have the insight into “what fields a method may touch”. I tend to treat it as an atomic unit, and I don’t find the rules prohibitive (now, maybe it influenced the author of the type in terms of the public API that they export).
There are some exceptions: the main ones that I’ve noticed involve collections. For example, I like split_at_mut on vectors, which covers more-or-less this same case. Similarly, I sometimes want the ability to have multiple mutable refs into a hashmap.
All of this is not to say that we don’t need to worry about external users at all – but I would say that for an external user, defining an explicit view or trait is not necessarily prohibitive. It makes sense because it is giving your users a “window” into your “mental model”. i.e., if you have a struct Connection that exposes two views, Buffer and Address, then you are telling them they can think of a connection has having those subparts, and then you may have distinct methods that sometimes operate only on the buffer, sometimes only on the address, etc.
Anyway, I am pretty excited about the idea of leveraging fields in traits for this. (Don’t have time to write a bunch here, more later.)