From 1a5dcedc6b09f7a38aefa75091412b3a104d39d6 Mon Sep 17 00:00:00 2001 From: Benedikt Steinbusch Date: Sat, 17 Feb 2024 10:18:47 +0100 Subject: [PATCH] remove FieldValueRequest from FieldValueSample --- nvml-wrapper/src/struct_wrappers/device.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nvml-wrapper/src/struct_wrappers/device.rs b/nvml-wrapper/src/struct_wrappers/device.rs index e836d78..b4e8cc4 100644 --- a/nvml-wrapper/src/struct_wrappers/device.rs +++ b/nvml-wrapper/src/struct_wrappers/device.rs @@ -3,7 +3,7 @@ use crate::enum_wrappers::device::{BridgeChip, EncoderType, FbcSessionType, Samp use crate::enums::device::{FirmwareVersion, SampleValue, UsedGpuMemory}; use crate::error::{nvml_try, Bits, NvmlError}; use crate::ffi::bindings::*; -use crate::structs::device::{FieldId, FieldValueRequest, ScopeId}; +use crate::structs::device::{FieldId, ScopeId}; #[cfg(feature = "serde")] use serde_derive::{Deserialize, Serialize}; use std::{ @@ -527,7 +527,9 @@ impl From for ProcessUtilizationSample { #[derive(Debug)] pub struct FieldValueSample { /// The field that this sample is for. - pub field: FieldValueRequest, + pub field: FieldId, + /// The field scope that this sample is for. + pub scope: ScopeId, /// This sample's CPU timestamp in μs (Unix time). pub timestamp: i64, /** @@ -555,7 +557,8 @@ impl TryFrom for FieldValueSample { */ fn try_from(value: nvmlFieldValue_t) -> Result { Ok(Self { - field: FieldValueRequest::id_with_scope(FieldId(value.fieldId), ScopeId(value.scopeId)), + field: FieldId(value.fieldId), + scope: ScopeId(value.scopeId), timestamp: value.timestamp, latency: value.latencyUsec, value: match nvml_try(value.nvmlReturn) {