33 releases

0.12.14 Feb 22, 2024
0.12.12 Oct 19, 2023
0.12.11 Jul 31, 2023
0.12.6 Feb 10, 2023
0.0.3 Jul 13, 2018

#3 in No standard library

Download history 554911/week @ 2024-01-05 530693/week @ 2024-01-12 573924/week @ 2024-01-19 560041/week @ 2024-01-26 612264/week @ 2024-02-02 561982/week @ 2024-02-09 590194/week @ 2024-02-16 659267/week @ 2024-02-23 683603/week @ 2024-03-01 595263/week @ 2024-03-08 598344/week @ 2024-03-15 612499/week @ 2024-03-22 678526/week @ 2024-03-29 634551/week @ 2024-04-05 678892/week @ 2024-04-12 619698/week @ 2024-04-19

2,723,731 downloads per month
Used in 2,773 crates (127 directly)

Apache-2.0 WITH LLVM-exception

95KB
2.5K SLoC

This is a library for managing targets for compilers and related tools.

Currently, the main feature is support for decoding "triples", which are strings that identify a particular target configuration. They're named "triples" because historically they contained three fields, though over time they've added additional fields. This library provides a Triple struct containing enums for each of fields of a triple. Triple implements FromStr and fmt::Display so it can be converted to and from the conventional string representation of a triple.

Triple also has functions for querying a triple's endianness, pointer bit width, and binary format.

And, Triple and the enum types have host() constructors, for targeting the host.

It supports all triples currently used by rustc and rustup.

It does not support reading JSON target files itself. To use it with a JSON target file, construct a Triple using the value of the "llvm-target" field.


lib.rs:

Target triple support.

Dependencies

~180KB