[][src]Struct mediocore::Core

pub struct Core { /* fields omitted */ }

Representation of the current cpufrequency serttings of a single core Can be obtained by running discover_core_settings

Methods

impl Core
[src]

pub fn discover(core: PathBuf) -> Result<Core>
[src]

discover settings for the core specified by its path

pub fn num(&self) -> u32
[src]

returns the number of the core

pub fn cpu_min(&self) -> u32
[src]

returns cpu minimum frequency in kHz

pub fn cpu_max(&self) -> u32
[src]

returns cpu maximum frequency in kHz

pub fn curr_min(&self) -> u32
[src]

returns current min scaling frequency in kHz

pub fn curr_max(&self) -> u32
[src]

returns current max scaling frequency in kHz

pub fn curr_gov(&self) -> &str
[src]

returns the current governor

pub fn available_govs(&self) -> &[String]
[src]

returns available governors

pub fn validate_min(&self, freq: u32) -> Result<u32>
[src]

Validate the given minimum value. Must be >= the discovered CPU frequency minimum

pub fn validate_max(&self, freq: u32) -> Result<u32>
[src]

Validate the given maximum value. Must be >= current min and <= CPU frequency maximum

pub fn validate_governor<'a>(&self, governor: &'a str) -> Result<&'a str>
[src]

Validate the governor by checking against the list of available governors

pub fn set_min(&mut self, freq: u32) -> Result<()>
[src]

Set the minimum scaling frequency (lower frequency limit) This operation is not checked by mediocore, but the kernel may refuse to accept certain inputs.
Use Core::validate_min on the value beforehand.

pub fn set_max(&mut self, freq: u32) -> Result<()>
[src]

Set the maximum scaling frequency (lower frequency limit)
This operation is not checked by mediocore, but the kernel may refuse to accept certain inputs.
Use Core::validate_max on the value beforehand.

pub fn set_governor(&mut self, guvnor: &str) -> Result<()>
[src]

Apply the given governor This operation is not checked by mediocore, but the kernel may refuse to accept certain inputs. Use Core::validate_governor on the value beforehand.

Trait Implementations

impl Clone for Core
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Core
[src]

impl Serialize for Core
[src]

impl<'de> Deserialize<'de> for Core
[src]

Auto Trait Implementations

impl Send for Core

impl Sync for Core

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]