Expand description
The “architecture” field
Tuple Fields§
§0: Cow<'static, str>
Implementations§
source§impl Arch
impl Arch
pub const aarch64: Arch = _
pub const arm: Arch = _
pub const avr: Arch = _
pub const bpf: Arch = _
pub const hexagon: Arch = _
pub const m68k: Arch = _
pub const mips: Arch = _
pub const mips64: Arch = _
pub const msp430: Arch = _
pub const nvptx64: Arch = _
pub const powerpc: Arch = _
pub const powerpc64: Arch = _
pub const riscv32: Arch = _
pub const riscv64: Arch = _
pub const s390x: Arch = _
pub const sparc: Arch = _
pub const sparc64: Arch = _
pub const wasm32: Arch = _
pub const wasm64: Arch = _
pub const x86: Arch = _
pub const x86_64: Arch = _
source§impl Arch
impl Arch
sourcepub fn new(val: impl Into<Cow<'static, str>>) -> Self
pub fn new(val: impl Into<Cow<'static, str>>) -> Self
Constructs a new instance of this field.
This method accepts both owned String
s and &'static str
s.
Examples found in repository?
src/expr.rs (lines 440-442)
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475
fn to_pred<'a>(&self, s: &'a str) -> Predicate<'a> {
use InnerPredicate as IP;
use Predicate::{
DebugAssertions, Feature, Flag, KeyValue, ProcMacro, Target, TargetFeature, Test,
};
match self {
IP::Target(it) => match &it.which {
Which::Abi => Target(TargetPredicate::Abi(targ::Abi::new(
s[it.span.clone().unwrap()].to_owned(),
))),
Which::Arch => Target(TargetPredicate::Arch(targ::Arch::new(
s[it.span.clone().unwrap()].to_owned(),
))),
Which::Os => Target(TargetPredicate::Os(targ::Os::new(
s[it.span.clone().unwrap()].to_owned(),
))),
Which::Vendor => Target(TargetPredicate::Vendor(targ::Vendor::new(
s[it.span.clone().unwrap()].to_owned(),
))),
Which::Env => Target(TargetPredicate::Env(targ::Env::new(
s[it.span.clone().unwrap()].to_owned(),
))),
Which::Family => Target(TargetPredicate::Family(targ::Family::new(
s[it.span.clone().unwrap()].to_owned(),
))),
Which::Endian(end) => Target(TargetPredicate::Endian(*end)),
Which::HasAtomic(has_atomic) => Target(TargetPredicate::HasAtomic(*has_atomic)),
Which::Panic => Target(TargetPredicate::Panic(targ::Panic::new(
s[it.span.clone().unwrap()].to_owned(),
))),
Which::PointerWidth(pw) => Target(TargetPredicate::PointerWidth(*pw)),
},
IP::Test => Test,
IP::DebugAssertions => DebugAssertions,
IP::ProcMacro => ProcMacro,
IP::Feature(rng) => Feature(&s[rng.clone()]),
IP::TargetFeature(rng) => TargetFeature(&s[rng.clone()]),
IP::Other { identifier, value } => match value {
Some(vs) => KeyValue {
key: &s[identifier.clone()],
val: &s[vs.clone()],
},
None => Flag(&s[identifier.clone()]),
},
}
}
sourcepub const fn new_const(val: &'static str) -> Self
pub const fn new_const(val: &'static str) -> Self
Constructs a new instance of this field from a &'static str
.
Examples found in repository?
src/targets/builtins.rs (line 2530)
2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550
pub const aarch64: Arch = Arch::new_const("aarch64");
pub const arm: Arch = Arch::new_const("arm");
pub const avr: Arch = Arch::new_const("avr");
pub const bpf: Arch = Arch::new_const("bpf");
pub const hexagon: Arch = Arch::new_const("hexagon");
pub const m68k: Arch = Arch::new_const("m68k");
pub const mips: Arch = Arch::new_const("mips");
pub const mips64: Arch = Arch::new_const("mips64");
pub const msp430: Arch = Arch::new_const("msp430");
pub const nvptx64: Arch = Arch::new_const("nvptx64");
pub const powerpc: Arch = Arch::new_const("powerpc");
pub const powerpc64: Arch = Arch::new_const("powerpc64");
pub const riscv32: Arch = Arch::new_const("riscv32");
pub const riscv64: Arch = Arch::new_const("riscv64");
pub const s390x: Arch = Arch::new_const("s390x");
pub const sparc: Arch = Arch::new_const("sparc");
pub const sparc64: Arch = Arch::new_const("sparc64");
pub const wasm32: Arch = Arch::new_const("wasm32");
pub const wasm64: Arch = Arch::new_const("wasm64");
pub const x86: Arch = Arch::new_const("x86");
pub const x86_64: Arch = Arch::new_const("x86_64");
Trait Implementations§
source§impl Ord for Arch
impl Ord for Arch
source§impl PartialEq<Arch> for Arch
impl PartialEq<Arch> for Arch
source§impl PartialOrd<Arch> for Arch
impl PartialOrd<Arch> for Arch
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more