add freerdp crate

This commit is contained in:
LDprg 2023-07-20 13:25:57 +02:00
parent 0435e9f45e
commit 2cb24fabe5
2 changed files with 29 additions and 10 deletions

19
winapps/src/freerdp.rs Normal file
View File

@ -0,0 +1,19 @@
pub mod freerdp {
use crate::RemoteClient;
struct Freerdp {}
impl RemoteClient for Freerdp {
fn check_depends(&self) {
todo!()
}
fn load_config(&self, path: &str) {
todo!()
}
fn run_app(&self, app: &str) {
todo!()
}
}
}

View File

@ -7,6 +7,16 @@ use std::{
path::Path, path::Path,
}; };
mod freerdp;
pub trait RemoteClient {
fn check_depends(&self);
fn load_config(&self, path: &str);
fn run_app(&self, app: &str);
}
#[derive(new, Debug, Deserialize, Serialize)] #[derive(new, Debug, Deserialize, Serialize)]
pub struct Config { pub struct Config {
#[new(value = "HostConfig::new()")] #[new(value = "HostConfig::new()")]
@ -33,16 +43,6 @@ pub struct RemoteConfig {
password: String, password: String,
} }
pub trait RemoteClient {
fn check_depends(&self) -> bool {
panic!("Dependency check not implemented!");
}
fn load_config(&self, path: &str);
fn run_app(&self, app: &str);
}
pub fn load_config(path: Option<&str>) -> Config { pub fn load_config(path: Option<&str>) -> Config {
let home = home_dir().expect("Could not find the home path!"); let home = home_dir().expect("Could not find the home path!");
let default = &format!("{}{}", home.to_str().unwrap(), "/.config/winapps/"); let default = &format!("{}{}", home.to_str().unwrap(), "/.config/winapps/");