You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

54 lines
1.0 KiB

use serde::{
Deserialize,
Serialize
};
use std::{
collections::HashMap
};
use uuid::Uuid;
use super::{
ToMsg,
Job
};
use crate::UID;
pub type CliStorage = HashMap<Uuid, UClient>;
pub struct UClient {
pub client_info: ClientInfo,
pub jobs: Vec<Box<Jobs>> // TODO: to futures
}
impl UClient {
pub fn new(client_info: ClientInfo) -> Self {
Self {
client_info,
jobs: Vec::new()
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ClientInfo {
pub local_ip: String,
pub hostname: String,
pub username: String,
pub os: String,
pub platform: String,
pub id: Uuid,
}
impl ClientInfo {
pub fn gather() -> Self {
ClientInfo {
local_ip: String::from("1.2.3.4"),
hostname: String::from("polokonzerva"),
username: String::from("plazmoid"),
os: String::from("pinux"),
platform: String::from("x86_64"),
id: *UID
}
}
}
impl ToMsg for ClientInfo {}