Struct AmdMon

Source
pub struct AmdMon {
    pub pwm_min: Option<u32>,
    pub pwm_max: Option<u32>,
    /* private fields */
}

Fields§

§pwm_min: Option<u32>

Minimal modulation (between 0-255)

§pwm_max: Option<u32>

Maximal modulation (between 0-255)

Implementations§

Source§

impl AmdMon

Source

pub fn wrap_all(mons: Vec<HwMon>, config: &Config) -> Vec<Self>

Source

pub fn wrap(hw_mon: HwMon, config: &Config) -> Self

Source

pub fn gpu_temp(&self) -> Vec<(&String, Result<f64>)>

Returns name and gpu temperature percent of maximum GPU temperature range

Source

pub fn gpu_usage(&self) -> Result<f64>

GPU usage percent

Source

pub fn gpu_temp_of(&self, input_idx: usize) -> Option<(&String, Result<f64>)>

Source

pub fn read_gpu_temp(&self, name: &str) -> Result<u64>

Source

pub fn gpu_usage_of(&self, input_idx: usize) -> Option<(&String, Result<f64>)>

Source

pub fn read_gpu_usage(&self, name: &str) -> Result<u16>

Source

pub fn pwm(&self) -> Result<u32>

Source

pub fn pwm_min(&mut self) -> u32

Source

pub fn pwm_max(&mut self) -> u32

Source

pub fn max_gpu_temp(&self) -> Result<f64>

Methods from Deref<Target = HwMon>§

Source

pub fn card(&self) -> &Card

Source

pub fn name(&self) -> Result<String, AmdGpuError>

Source

pub fn gpu_usage(&self) -> Result<f64, AmdGpuError>

GPU usage percent

Source

pub fn read_gpu_usage(&self) -> Result<u16, AmdGpuError>

Source

pub fn is_amd(&self) -> bool

Source

pub fn name_is_amd(&self) -> bool

Source

pub fn device_dir(&self) -> PathBuf

Source

pub fn mon_dir(&self) -> PathBuf

Source

pub fn value_or<R>(&self, name: &str, fallback: R) -> R
where R: FromStr,

Source

pub fn hw_mon_read(&self, name: &str) -> Result<String, AmdGpuError>

Source

pub fn device_read(&self, name: &str) -> Result<String, AmdGpuError>

Source

pub fn hw_mon_write(&self, name: &str, value: u64) -> Result<(), AmdGpuError>

Source

pub fn device_write<C>(&self, name: &str, value: C) -> Result<(), AmdGpuError>
where C: AsRef<[u8]>,

Trait Implementations§

Source§

impl Deref for AmdMon

Source§

type Target = HwMon

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl Freeze for AmdMon

§

impl RefUnwindSafe for AmdMon

§

impl Send for AmdMon

§

impl Sync for AmdMon

§

impl Unpin for AmdMon

§

impl UnwindSafe for AmdMon

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more