Expand description
The “vendor” field, which in practice is little more than an arbitrary modifier.
Tuple Fields§
§0: Cow<'static, str>
Implementations§
source§impl Vendor
impl Vendor
pub const apple: Vendor = _
pub const espressif: Vendor = _
pub const fortanix: Vendor = _
pub const kmc: Vendor = _
pub const nintendo: Vendor = _
pub const nvidia: Vendor = _
pub const pc: Vendor = _
pub const sony: Vendor = _
pub const sun: Vendor = _
pub const unknown: Vendor = _
pub const uwp: Vendor = _
pub const wrs: Vendor = _
source§impl Vendor
impl Vendor
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 446-448)
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 2554)
2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565
pub const apple: Vendor = Vendor::new_const("apple");
pub const espressif: Vendor = Vendor::new_const("espressif");
pub const fortanix: Vendor = Vendor::new_const("fortanix");
pub const kmc: Vendor = Vendor::new_const("kmc");
pub const nintendo: Vendor = Vendor::new_const("nintendo");
pub const nvidia: Vendor = Vendor::new_const("nvidia");
pub const pc: Vendor = Vendor::new_const("pc");
pub const sony: Vendor = Vendor::new_const("sony");
pub const sun: Vendor = Vendor::new_const("sun");
pub const unknown: Vendor = Vendor::new_const("unknown");
pub const uwp: Vendor = Vendor::new_const("uwp");
pub const wrs: Vendor = Vendor::new_const("wrs");
Trait Implementations§
source§impl Ord for Vendor
impl Ord for Vendor
source§impl PartialEq<Vendor> for Vendor
impl PartialEq<Vendor> for Vendor
source§impl PartialOrd<Vendor> for Vendor
impl PartialOrd<Vendor> for Vendor
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