Hello,
i'm new to Rust and i'm coming fresh from the high level coding (php,javascript and so on) and in my youth i have coded in pascal,c and c++. Now i my old ages;) i comes back to the systemcoding, back to the low level, and i miss the thousands helpers in high level;).
So my problem is. I read a simple config file with = sign to point for the value.
Path="/Path/Path"
In my module i have a function thats reads the line and now i need a simple method to save the variables by runtime.
I want simple an array like this
let config_vars = [config_id_name[config_id_value]]
let config_vars = [config_id_name[config_id_value]]
let config_vars = [config_id_name[config_id_value]]
config_vars["Path"] =
at this time fetched from config value;). Is that possible or can i really only index with usize?
Another way, the better why oop
struct Option
{
config_id:String,
config_name:String,
}
and with impl a construction that i can make this:
let cfg = Option ..... cfg["Path"]
(so great if multidim;) cfg["Path"]["forthat"].config_value
or so. like an object with an indexed array properties.
Yes i can name the object like the config_id
but that sounds not right and are overdosed, i found.
let config_id_path = Config ....
I hope this is easy possible, why it is an easy problem. Okay not for me at this time and in rust.