switchtec-user-sys 0.1.3

Rust wrapper for the switchtec-user C library
docs.rs failed to build switchtec-user-sys-0.1.3
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: switchtec-user-sys-0.4.2

switchtec-user-sys

A Rust wrapper for the switchtec-user library.

Details and usage instructions for the switchtec-user library can be found here.

Example Usage

use std::env;

use switchtec_user_sys::{switchtec_die_temp, SwitchtecDevice};

fn main() -> anyhow::Result<()> {
    let path = env::args()
        .skip(1)
        .next()
        .unwrap_or_else(|| "/dev/pciswitch0".to_owned());

    let dev = SwitchtecDevice::new(path).open()?;

    unsafe {
        let temp = switchtec_die_temp(*dev);
        println!("Temperature: {}", temp);
    }

    Ok(())
}

License

switchtec-user-sys is both MIT and Apache License, Version 2.0 licensed, as found in the LICENSE-MIT and LICENSE-APACHE files.