1mod os_name;
2mod arch;
3mod environment;
4
5use crate::os_name::ret_os_name;
6use crate::arch::ret_arch;
7use crate::environment::ret_environment;
8
9#[derive(Debug)]
11pub struct Desktop {
12 os_name: &'static str,
13 arch: &'static str,
14 environment: &'static str,
15}
16
17impl Desktop {
18 pub fn get() -> Self {
20 Desktop {
21 os_name: ret_os_name(),
22 arch: ret_arch(),
23 environment: ret_environment(),
24 }
25 }
26
27 pub fn os_name(&self) -> &'static str {
29 self.os_name
30 }
31
32 pub fn arch(&self) -> &'static str {
34 self.arch
35 }
36
37 pub fn environment(&self) -> &'static str {
43 self.environment
44 }
45}
46
47#[test]
48fn test_struct() {
49 let d = Desktop::get();
50 println!("{:#?}", d);
51}