I have a structure and a function call:
pub fn get_exchanges(database: &str) -> Result<Vec<Exchanges>> {
todo!()
}
pub struct Exchanges {
pub rowid: u64,
pub table_name: String,
pub profile_id: String,
pub name: String,
pub etl_type: i16,
pub connection_info: String,
pub update_flag: bool,
pub date_last_update: String,
pub gui_show: bool,
pub reports_flag: bool,
}
I want to pull out the name within the structure and do some work on it. I have an iterator but cannot figure out how to get to the specific item called name
.
let exchanges_list = get_exchanges("crypto.db");
for name in exchanges_list {
println!("exchange {:?}", name);
//ui.horizontal(|ui| ui.label(exchange));
}
The result is
Exchanges { rowid: 4, table_name: "exchanges", profile_id: "None", name: "coinbasepro_noFlag", etl_type: 2, connection_info: "{\"name\":\"coinbase_pro\",\"base_url\":\"https://api.pro.coinbase.com\",\"key\":\"[redacted]\",\"secret\":\"[redacted]\",\"passphrase\":\"[redacted]\"}", update_flag: false, date_last_update: "2009-01-02 00:00:00 UTC", gui_show: true, reports_flag: true }