AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
The Type System in Rust
In Rust, you can have a struct which is an animal or a dog and it has certain attributes like name. And then in Rust, you take a second step and implement this struct where in this implement block of this struct, you will define the functions for the struct. How about generics? The syntax looks a little bit or a lot like Java and C sharp, how are generics used in Rust? So the power of generics is that you don't really know which actual type you pass to this function.