22 releases

0.3.2 Jul 30, 2021
0.3.1 May 1, 2020
0.3.0 Jan 6, 2020
0.2.2 Jan 2, 2019
0.1.8 Nov 3, 2017

#483 in Rust patterns

Download history 5011/week @ 2023-12-16 2757/week @ 2023-12-23 3804/week @ 2023-12-30 5037/week @ 2024-01-06 6552/week @ 2024-01-13 7133/week @ 2024-01-20 5501/week @ 2024-01-27 5120/week @ 2024-02-03 4795/week @ 2024-02-10 6129/week @ 2024-02-17 6457/week @ 2024-02-24 5227/week @ 2024-03-02 6349/week @ 2024-03-09 5821/week @ 2024-03-16 5468/week @ 2024-03-23 4137/week @ 2024-03-30

22,547 downloads per month
Used in 14 crates (3 directly)

Apache-2.0

2MB
611 lines

rust_info

crates.io CI codecov
license Libraries.io for GitHub Documentation downloads
Built with cargo-make

Extracts the current rust compiler information.

Overview

This library main goal is to provide development/build tools such as cargo-make the needed information on the current rust installation and setup.

Usage

Simply include the library and invoke the get function to pull all info as follows:

fn main() {
    let rust_info = rust_info::get();

    println!("Version: {}", rust_info.version.unwrap());
    println!("Channel: {:#?}", rust_info.channel.unwrap());
    println!(
        "Target Arch: {}",
        rust_info.target_arch.unwrap_or("unknown".to_string())
    );
    println!(
        "Target Env: {}",
        rust_info.target_env.unwrap_or("unknown".to_string())
    );
    println!(
        "Target OS: {}",
        rust_info.target_os.unwrap_or("unknown".to_string())
    );
    println!(
        "Target Pointer Width: {}",
        rust_info
            .target_pointer_width
            .unwrap_or("unknown".to_string())
    );
    println!(
        "Target Vendor: {}",
        rust_info.target_vendor.unwrap_or("unknown".to_string())
    );
    println!(
        "Target Triple: {}",
        rust_info.target_triple.unwrap_or("unknown".to_string())
    );
}

Installation

In order to use this library, just add it as a dependency:

[dependencies]
rust_info = "^0.3.2"

API Documentation

See full docs at: API Docs

Contributing

See contributing guide

Release History

See Changelog

License

Developed by Sagie Gur-Ari and licensed under the Apache 2 open source license.

No runtime deps