1 Simple example:
struct Person_and_program
<'a> {
#[builder(setter(into, strip_option))]
my_name: (String,String, Option<String>),
your_name: (String,String, Option<String>)}
I want to declare smth #[builder(...)] on several fields, not to clutter up code, how can I do this?
Also I want arbitrary number of Strings(or other... integers for ex., how do this?)
...
Arb_numbers: numbes*... //It's example, i don't know)
...
2 (Simply also don't know) Suppose I want to create a little interface to interect with someone in programm, I want different languages and renaming files accordingly what I need. For simpicity, I am creating struct and some functions with HashMap, as example:
impl Datas{
fn from_default_languages (&mut self) -> HashMap<String,String> {
let mut data_lang = HashMap::new();
data_lang.insert("عرب(Arabian)".to_string(),String::from("السلام عليكم"),);
data_lang.insert("English".to_string(),String::from("Hello"));
data_lang.insert("हिंदी(Hindi)".to_string(),String::from("नमस्ते"));
data_lang.insert("日本人(Japanese)".to_string(),String::from("こんにちは"));
data_lang.insert("한국어(Korean)".to_string(),String::from("안녕하세요"));
data_lang.insert("中文(Chinese)".to_string(),String::from("你好"));
data_lang.insert("Português".to_string(),String::from("Olá"));
data_lang.insert("Русский".to_string(),String::from("Здравствуйте"));
data_lang.insert("Español".to_string(),String::from("Hola"));
//let mut some_inter = BTreeMap::<String,String>::new();
self.languages = data_lang;}
But also If I transfer data(structure) in json, what advantages or disadvantages of this will be?
As in previous example, i thought for simplicity like this: [Arabic-> then several phrases(as values) ...
Maybe create struct with two fields and hasmap on them], but it's not so flawless style))
3 How can I save big datas(not as above) more fast and safely accordingly to rust(mysql...but as the time being I don't know anything about data base, maybe some newest you know).
4 Also I want something with std::io to interact with somebody using program, many people i suppose had already create something safe on rust (not like in documentation, as simple examples), so question: Did you know dynamic interaction using io in rust, for example modules, saving some statistic from person.
And maybe i will write several programms, and will need to correct in one, and affect the same data in related to latter ... thanks)