Borrowed tuple indexing for HashMap
Summary
The article analyzes the challenge of indexing a Rust HashMap with borrowed tuple keys and explains why a naive Borrow implementation fails. It then presents a workaround using a custom BorrowedKey trait and dynamic trait objects to enable borrowed key lookups, including careful attention to lifetimes and how hashing and equality are implemented. The content includes code examples and practical explanations of fat pointers in trait objects.