Struct nvml_wrapper::unit::Unit [] [src]

pub struct Unit<'nvml> { /* fields omitted */ }

Struct that represents a unit.

Obtain a Unit with the various methods available to you on the NVML struct.

I don't know what a unit is, but inferring from the docs leads me to believe it's some kind of high-end something-or-other that 99% of users won't know about either. That being said, I'm wrapping this whole library, so here you go.

Rust's lifetimes will ensure that the NVML instance this Unit was created from is not allowed to be shutdown until this Unit is dropped, meaning you shouldn't have to worry about calls returning Uninitialized errors.

Methods

impl<'nvml> Unit<'nvml>
[src]

Gets the set of GPU devices that are attached to this Unit.

I do not have the hardware to test this call. Verify for yourself that it works before you use it. If it works, please let me know; if it doesn't, I would love a PR. If NVML is sane this should work, but NVIDIA's docs on this call are anything but clear.

Errors

  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the unit is invalid
  • Unknown, on any unexpected error

Device Support

For S-class products.

Gets the count of GPU devices that are attached to this Unit.

I do not have the hardware to test this call. Verify for yourself that it works before you use it. If it works, please let me know; if it doesn't, I would love a PR. If NVML is sane this should work, but NVIDIA's docs on this call are anything but clear.

Errors

  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the unit is invalid
  • Unknown, on any unexpected error

Device Support

For S-class products.

Gets fan information for this Unit (fan count and state + speed for each).

Errors

  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the unit is invalid
  • NotSupported, if this is not an S-class product
  • Unknown, on any unexpected error

Device Support

For S-class products.

Gets the LED state associated with this Unit.

Errors

  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the unit is invalid
  • NotSupported, if this is not an S-class product
  • Utf8Error, if the string obtained from the C function is not valid Utf8
  • Unknown, on any unexpected error

Device Support

For S-class products.

Gets the PSU stats for this Unit.

Errors

  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the unit is invalid
  • NotSupported, if this is not an S-class product
  • Utf8Error, if the string obtained from the C function is not valid Utf8
  • Unknown, on any unexpected error

Device Support

For S-class products.

Gets the temperature for the specified UnitTemperatureReading, in °C.

Available readings depend on the product.

Errors

  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the unit is invalid
  • NotSupported, if this is not an S-class product
  • Unknown, on any unexpected error

Device Support

For S-class products. Available readings depend on the product.

Gets the static information associated with this Unit.

Errors

  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the unit is invalid
  • Utf8Error, if the string obtained from the C function is not valid Utf8

Device Support

For S-class products.

Sets the LED color for this Unit.

Requires root/admin permissions. This operation takes effect immediately.

Note: Current S-class products don't provide unique LEDs for each unit. As such, both front and back LEDs will be toggled in unison regardless of which unit is specified with this method (aka the Unit represented by this struct).

Errors

  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the unit is invalid
  • NotSupported, if this is not an S-class product
  • NoPermission, if the user doesn't have permission to perform this operation
  • Unknown, on any unexpected error

Device Support

For S-class products.

Consume the struct and obtain the raw unit handle that it contains.

Obtain a reference to the raw unit handle contained in the struct.

Obtain a mutable reference to the raw unit handle contained in the struct.

Sometimes necessary for C interop. Use carefully.

Trait Implementations

impl<'nvml> Debug for Unit<'nvml>
[src]

Formats the value using the given formatter.

impl<'nvml> Send for Unit<'nvml>
[src]

impl<'nvml> Sync for Unit<'nvml>
[src]

impl<'nvml> From<nvmlUnit_t> for Unit<'nvml>
[src]

Performs the conversion.