Crates.io | rust_info |
lib.rs | rust_info |
version | 0.3.3 |
source | src |
created_at | 2017-10-10 06:53:55.114021 |
updated_at | 2024-08-30 12:17:47.768745 |
description | Extracts the current rust compiler information. |
homepage | http://github.com/sagiegurari/rust_info |
repository | https://github.com/sagiegurari/rust_info.git |
max_upload_size | |
id | 35076 |
size | 1,473,753 |
Extracts the current rust compiler information.
This library main goal is to provide development/build tools such as cargo-make the needed information on the current rust installation and setup.
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())
);
}
In order to use this library, just add it as a dependency:
[dependencies]
rust_info = "^0.3.3"
See full docs at: API Docs
See Changelog
Developed by Sagie Gur-Ari and licensed under the Apache 2 open source license.