Struct CustomHardwareInfo

Source
pub struct CustomHardwareInfo {
Show 14 fields pub cpu: Option<CPUInfo>, pub gpus: Vec<GPUInfo>, pub memory: Option<MemoryInfo>, pub storage_devices: Vec<StorageInfo>, pub network_interfaces: Vec<NetworkInfo>, pub battery: Option<BatteryInfo>, pub thermal: Option<ThermalInfo>, pub pci_devices: Vec<PCIDevice>, pub usb_devices: Vec<USBDevice>, pub virtualization: Option<VirtualizationInfo>, pub power_profile: Option<PowerProfile>, pub timestamp: SystemTime, pub query_time_ms: u64, pub requested_components: Vec<String>,
}
Expand description

Customizable hardware information result

Fields§

§cpu: Option<CPUInfo>§gpus: Vec<GPUInfo>§memory: Option<MemoryInfo>§storage_devices: Vec<StorageInfo>§network_interfaces: Vec<NetworkInfo>§battery: Option<BatteryInfo>§thermal: Option<ThermalInfo>§pci_devices: Vec<PCIDevice>§usb_devices: Vec<USBDevice>§virtualization: Option<VirtualizationInfo>§power_profile: Option<PowerProfile>§timestamp: SystemTime

Timestamp when this information was collected

§query_time_ms: u64

Query execution time in milliseconds

§requested_components: Vec<String>

Which components were requested

Implementations§

Source§

impl CustomHardwareInfo

Source

pub fn has_component(&self, component: &str) -> bool

Check if a specific component was included in the query

Source

pub fn component_count(&self) -> usize

Get the total number of components that were queried

Source

pub fn to_full_hardware_info(&self) -> HardwareInfo

Convert to a full HardwareInfo struct (filling missing components with defaults)

Source

pub fn query_summary(&self) -> String

Get a summary of what was queried

Trait Implementations§

Source§

impl Debug for CustomHardwareInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CustomHardwareInfo

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for CustomHardwareInfo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,