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.

49 lines
951 B

4 years ago
use serde::{
Deserialize,
Serialize
};
use uuid::Uuid;
4 years ago
use crate::{
contracts::*,
UID
4 years ago
};
4 years ago
pub struct UClient {
pub client_info: ClientInfo,
pub jobs: Vec<JobMeta>, // TODO: to futures
4 years ago
}
impl UClient {
pub fn new(client_info: ClientInfo) -> Self {
Self {
client_info,
jobs: Vec::new()
4 years ago
}
}
}
4 years ago
4 years ago
#[derive(Serialize, Deserialize, Debug, Clone)]
4 years ago
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"),
4 years ago
username: String::from("plazmoid"),
4 years ago
os: String::from("pinux"),
platform: String::from("x86_64"),
4 years ago
id: *UID
4 years ago
}
}
}
4 years ago
impl ToMsg for ClientInfo {}