psutil/host/
info.rs

1#[cfg(feature = "serde")]
2use serde::{Deserialize, Serialize};
3
4use platforms::target::{Arch, OS};
5
6/// Not found in Python psutil.
7#[cfg_attr(feature = "serde", serde(crate = "renamed_serde"))]
8#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9#[derive(Clone, Debug)]
10pub struct Info {
11	pub(crate) operating_system: OS,
12	pub(crate) release: String,
13	pub(crate) version: String,
14	pub(crate) hostname: String,
15	pub(crate) architecture: Option<Arch>,
16}
17
18impl Info {
19	pub fn operating_system(&self) -> OS {
20		self.operating_system
21	}
22
23	pub fn release(&self) -> &str {
24		&self.release
25	}
26
27	pub fn version(&self) -> &str {
28		&self.version
29	}
30
31	pub fn hostname(&self) -> &str {
32		&self.hostname
33	}
34
35	pub fn architecture(&self) -> Option<Arch> {
36		self.architecture
37	}
38}