mirror of
https://github.com/winapps-org/winapps.git
synced 2025-06-06 15:17:19 +02:00
add freerdp crate
This commit is contained in:
parent
0435e9f45e
commit
2cb24fabe5
19
winapps/src/freerdp.rs
Normal file
19
winapps/src/freerdp.rs
Normal 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!()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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/");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user