rustc-targets

Crates.iorustc-targets
lib.rsrustc-targets
version0.1.0
sourcesrc
created_at2023-02-03 02:45:17.227313
updated_at2023-02-03 02:45:17.227313
descriptionGet the list of targets supported by rustc.
homepage
repositoryhttps://github.com/JohnScience/rustc-targets
max_upload_size
id775352
size16,444
Dmitrii - Demenev (JohnScience)

documentation

https://docs.rs/rustc-targets

README

rustc-targets

crates.io crates.io

Library for getting the list of targets supported by rustc.

Usage

Add this to your Cargo.toml:

[dependencies]
rustc-targets = "0.1"

after that you can use it like this:

fn main() {
    let targets = rustc_targets::from_cli().unwrap();
    for (i,target) in targets.iter().unwrap().enumerate() {
        println!("{i}. {target}");
    }
}

Running example

cargo run --example targets

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Commit count: 1

cargo fmt