Simulating inheritance in rust