Is it possible to create custom data types in rust that can be indexed like Vec and Slice? If yes which Traits do I need to implement?
Example for indexed access:
let mut vec = vec![1, 2, 3];
assert_eq!(vec[1], 2);
Is it possible to create custom data types in rust that can be indexed like Vec and Slice? If yes which Traits do I need to implement?
Example for indexed access:
let mut vec = vec![1, 2, 3];
assert_eq!(vec[1], 2);