windows-eco 0.1.0

A safe, idiomatic Rust wrapper for the Windows Power Throttling API.
Documentation
  • Coverage
  • 96.05%
    73 out of 76 items documented0 out of 65 items with examples
  • Size
  • Source code size: 23.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.97 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 27s Average build duration of successful builds.
  • all releases: 27s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • kkent030315/windows-eco
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kkent030315

CI

windows-eco

A safe, idiomatic Rust wrapper for the Windows Power Throttling API.

Installation

Add this to your Cargo.toml:

[dependencies]

windows-eco = "..."

or invoke command:

cargo add windows-eco

Quick Start

use std::{thread, time::Duration};

use windows_eco::process::ProcessPowerThrottlingState;

fn main() -> Result<(), windows_eco::Error> {
    let mut state = ProcessPowerThrottlingState::from_windows()?;
    println!("{state}");
    state.enable_all_throttling();
    state.apply()?;
    println!("{state}");

    thread::sleep(Duration::from_secs(30));

    Ok(())
}

Limitations

This library only works on Windows platforms.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

License

MIT License - see the LICENSE file for details.