Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. pub trait HashBuilder<T> {
  2. fn build(key: T) -> usize;
  3. }
  4.  
  5. struct HashMap<K, V> {
  6. key: K,
  7. value: V
  8. }
  9.  
  10. impl<K, V> HashBuilder<K> for HashMap<K, V> {
  11. fn build(key: K) -> usize {
  12. // Some Implementation that changes, respective to the way HashMap key: type is
  13. // defined...
  14. return 23 as usize;
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement