These are chat archives for rust-lang/rust
Rust is going to be nicer to people with high-level-language background.
Funny how the more Rust I do, the more I'm growing into believing the contrary :-) but hey, maybe just my subjective experience
I do find myself struggling to model some things in rust, but thats mostly a lack of knowledge. For example, right now I'm parsing a stream of binary data using nom. Each packet in the stream has a 4 byte header, two for the kind, two for the length and then some data that is specific for the kind of packet.
So I thought, let's make a struct with two fields, header and payload, where header is another struct Header that holds kind, enum and length, u16. But now I'm stuck in figuring how to get the payload to be a struct that represents the kind as specified in the header.