pub struct Target { /* private fields */ }Expand description
A compilation target, identified by an LLVM-style triple.
Target wraps [target_lexicon::Triple] so the parser, validator, and
host-detection logic come “for free” from the upstream crate. Anything
LLVM understands is accepted; only the targets in Target::all() are
“blessed” (i.e. tested and supported).
Implementations§
Source§impl Target
impl Target
Sourcepub fn from_triple(triple: Triple) -> Self
pub fn from_triple(triple: Triple) -> Self
Construct a target from a [target_lexicon::Triple].
Sourcepub fn triple_string(&self) -> String
pub fn triple_string(&self) -> String
The triple as a string suitable for passing to LLVM (e.g.
"x86_64-unknown-linux-gnu").
Sourcepub fn all() -> Vec<Target>
pub fn all() -> Vec<Target>
The curated list of “blessed” targets — those Gruel explicitly tests
and supports. Other LLVM-known triples are accepted (from_str
succeeds) but unblessed.
Sourcepub fn is_blessed(&self) -> bool
pub fn is_blessed(&self) -> bool
Whether the triple is in the blessed list.
Trait Implementations§
Source§impl FromStr for Target
impl FromStr for Target
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parse a target from any LLVM-understood triple. Accepts a few
short-form aliases (x86_64-linux, aarch64-linux,
aarch64-macos, arm64-linux, arm64-macos) used historically by
the CLI.