Expand description
The “environment” field, which specifies an ABI environment on top of the operating system. In many configurations, this field is omitted, and the environment is implied by the operating system.
Tuple Fields§
§0: Cow<'static, str>
Implementations§
source§impl Env
impl Env
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 449-451)
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()]),
},
}
}
Trait Implementations§
source§impl Ord for Env
impl Ord for Env
source§impl PartialOrd<Env> for Env
impl PartialOrd<Env> for Env
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