pub struct Unit(/* private fields */);Implementations§
Source§impl Unit
impl Unit
pub const unsafe fn from_raw(handle: nvmlUnit_t) -> Self
pub const fn as_raw(self) -> nvmlUnit_t
pub const fn is_null(self) -> bool
Sourcepub fn info(self) -> Result<UnitInfo>
pub fn info(self) -> Result<UnitInfo>
Returns the static information associated with a unit.
For S-class products.
Returns the static unit information reported by NVML.
§Errors
Returns an error if the unit handle or output argument is invalid, or if NVML has not been initialized.
Sourcepub fn led_state(self) -> Result<LedState>
pub fn led_state(self) -> Result<LedState>
Returns the LED state associated with this unit.
For S-class products.
Returns the LED state reported by NVML.
§Errors
Returns an error if the unit handle or output argument is invalid, if this is not an S-class product, if NVML has not been initialized, or if NVML reports an unexpected failure.
Sourcepub fn psu_info(self) -> Result<PsuInfo>
pub fn psu_info(self) -> Result<PsuInfo>
Returns the PSU stats for the unit.
For S-class products.
Returns the PSU information reported by NVML.
§Errors
Returns an error if the unit handle or output argument is invalid, if this is not an S-class product, if NVML has not been initialized, or if NVML reports an unexpected failure.
Sourcepub fn temperature(self, kind: UnitTemperatureType) -> Result<UnitTemperature>
pub fn temperature(self, kind: UnitTemperatureType) -> Result<UnitTemperature>
Returns the temperature readings for the unit, in degrees C.
For S-class products.
Depending on the product, readings may be available for intake (type=0), exhaust (type=1) and board (type=2).
§Errors
Returns an error if the unit handle, temperature type, or output argument is invalid, if this is not an S-class product, if NVML has not been initialized, or if NVML reports an unexpected failure.
Sourcepub fn fan_speeds(self) -> Result<UnitFanSpeeds>
pub fn fan_speeds(self) -> Result<UnitFanSpeeds>
Returns the fan speed readings for the unit.
For S-class products.
Returns the fan speed information reported by NVML.
§Errors
Returns an error if the unit handle or output argument is invalid, if this is not an S-class product, if NVML has not been initialized, or if NVML reports an unexpected failure.
Sourcepub fn devices(self) -> Result<Vec<Device>>
pub fn devices(self) -> Result<Vec<Device>>
Returns the set of GPU devices that are attached to the specified unit.
For S-class products.
This wrapper queries the device count internally and returns attached devices as a Vec.
§Errors
Returns an error if the internal device buffer is too small, if the unit handle or query arguments are invalid, if NVML has not been initialized, or if NVML reports an unexpected failure.