Hi all.
I think I'm currently dealing with the fact that Rust doesn't let me to explicitly define the absence of value, like null
in C or None
in Python. Please correct me if I'm wrong.
I want to have a file File field inside a struct:
use std::fs::File;
struct MyStruct {
file: File,
other_thing: i32
}
I also want to instantiate this struct and start using the other_thing
field and only later open the file when its name becomes available due to the application logic.
What's the proper (rusty?) way to do this?
Thanks a lot.