PState

Struct PState 

Source
pub struct PState { /* private fields */ }
Expand description

Handle for fetching and modifying Intel PState kernel parameters.

§Note

  • Currently, ony Linux is supported.
  • Setting parameters will require root permissions.

Implementations§

Source§

impl PState

Source

pub fn new() -> Result<PState, PStateError>

Attempt to fetch a handle to the Intel PState sysfs kernel instance.

Source

pub fn hwp_dynamic_boost(&self) -> Result<Option<bool>, PStateError>

Get the status of HWP dynamic boost, if it is available.

Source

pub fn set_hwp_dynamic_boost(&self, boost: bool) -> Result<(), PStateError>

Set the HWP dynamic boost status.

Source

pub fn min_perf_pct(&self) -> Result<u8, PStateError>

Get the minimum performance percent.

Source

pub fn set_min_perf_pct(&self, min: u8) -> Result<(), PStateError>

Set the minimum performance percent.

Source

pub fn max_perf_pct(&self) -> Result<u8, PStateError>

Get the maximum performance percent.

Source

pub fn set_max_perf_pct(&self, max: u8) -> Result<(), PStateError>

Set the maximum performance percent.

Source

pub fn no_turbo(&self) -> Result<bool, PStateError>

If true, this signifies that turbo is disabled.

Source

pub fn set_no_turbo(&self, no_turbo: bool) -> Result<(), PStateError>

Set the no_turbo value; true will disable turbo.

Source

pub fn values(&self) -> Result<PStateValues, PStateError>

Get current PState values.

Source

pub fn set_values(&self, values: PStateValues) -> Result<(), PStateError>

Set all values in the given config.

Auto Trait Implementations§

§

impl Freeze for PState

§

impl RefUnwindSafe for PState

§

impl Send for PState

§

impl Sync for PState

§

impl Unpin for PState

§

impl UnwindSafe for PState

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.