More changes. Not functional yet

This commit is contained in:
kdeng00
2024-04-14 20:01:16 -04:00
parent c7141533be
commit cae266340d
5 changed files with 80 additions and 17 deletions
+18 -11
View File
@@ -2,24 +2,31 @@ use serde::{Deserialize, Serialize};
use crate::models;
// mod managers {
#[derive(Debug, Deserialize, Serialize)]
pub struct UserManager {
user: models::user::User,
ica_action: models::icarus_action::IcarusAction,
pub user: models::user::User,
pub ica_action: models::icarus_action::IcarusAction,
}
impl UserManager {
// TODO: Implement
pub fn retrieve_user(&self) -> models::user::User {
return models::user::User {
username: String::from(""),
password: String::from(""),
};
return self.user.clone();
}
// TODO: Implement
fn parse_user_from_actions(&self) {}
pub fn parse_user_from_actions(&mut self) {
let args = &self.ica_action.flags;
for arg in args {
let flag = &arg.flag;
if flag == "-u" {
self.user.username = String::from(&arg.value);
}
if flag == "-p" {
self.user.password = String::from(&arg.value);
}
}
}
}
// }