Crates.io | windows-eco |
lib.rs | windows-eco |
version | 0.1.0 |
created_at | 2025-09-25 08:42:59.777974+00 |
updated_at | 2025-09-25 08:42:59.777974+00 |
description | A safe, idiomatic Rust wrapper for the Windows Power Throttling API. |
homepage | |
repository | https://github.com/kkent030315/windows-eco |
max_upload_size | |
id | 1854374 |
size | 24,211 |
A safe, idiomatic Rust wrapper for the Windows Power Throttling API.
Add this to your Cargo.toml
:
[dependencies]
windows-eco = "..."
or invoke command:
cargo add windows-eco
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(())
}
This library only works on Windows platforms.
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.
MIT License - see the LICENSE file for details.