windows-eco

Crates.iowindows-eco
lib.rswindows-eco
version0.1.0
created_at2025-09-25 08:42:59.777974+00
updated_at2025-09-25 08:42:59.777974+00
descriptionA safe, idiomatic Rust wrapper for the Windows Power Throttling API.
homepage
repositoryhttps://github.com/kkent030315/windows-eco
max_upload_size
id1854374
size24,211
(kkent030315)

documentation

README

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.

Commit count: 3

cargo fmt