Expand description
The “operating system” field, which sometimes implies an environment, and sometimes isn’t an actual operating system.
Tuple Fields§
§0: Cow<'static, str>
Implementations§
source§impl Os
impl Os
pub const android: Os = _
pub const cuda: Os = _
pub const dragonfly: Os = _
pub const emscripten: Os = _
pub const espidf: Os = _
pub const freebsd: Os = _
pub const fuchsia: Os = _
pub const haiku: Os = _
pub const hermit: Os = _
pub const horizon: Os = _
pub const illumos: Os = _
pub const ios: Os = _
pub const l4re: Os = _
pub const linux: Os = _
pub const macos: Os = _
pub const netbsd: Os = _
pub const openbsd: Os = _
pub const psp: Os = _
pub const redox: Os = _
pub const solaris: Os = _
pub const solid_asp3: Os = _
pub const tvos: Os = _
pub const uefi: Os = _
pub const unknown: Os = _
pub const vxworks: Os = _
pub const wasi: Os = _
pub const watchos: Os = _
pub const windows: Os = _
pub const xous: Os = _
source§impl Os
impl Os
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 443-445)
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 2569)
2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597
pub const android: Os = Os::new_const("android");
pub const cuda: Os = Os::new_const("cuda");
pub const dragonfly: Os = Os::new_const("dragonfly");
pub const emscripten: Os = Os::new_const("emscripten");
pub const espidf: Os = Os::new_const("espidf");
pub const freebsd: Os = Os::new_const("freebsd");
pub const fuchsia: Os = Os::new_const("fuchsia");
pub const haiku: Os = Os::new_const("haiku");
pub const hermit: Os = Os::new_const("hermit");
pub const horizon: Os = Os::new_const("horizon");
pub const illumos: Os = Os::new_const("illumos");
pub const ios: Os = Os::new_const("ios");
pub const l4re: Os = Os::new_const("l4re");
pub const linux: Os = Os::new_const("linux");
pub const macos: Os = Os::new_const("macos");
pub const netbsd: Os = Os::new_const("netbsd");
pub const openbsd: Os = Os::new_const("openbsd");
pub const psp: Os = Os::new_const("psp");
pub const redox: Os = Os::new_const("redox");
pub const solaris: Os = Os::new_const("solaris");
pub const solid_asp3: Os = Os::new_const("solid_asp3");
pub const tvos: Os = Os::new_const("tvos");
pub const uefi: Os = Os::new_const("uefi");
pub const unknown: Os = Os::new_const("unknown");
pub const vxworks: Os = Os::new_const("vxworks");
pub const wasi: Os = Os::new_const("wasi");
pub const watchos: Os = Os::new_const("watchos");
pub const windows: Os = Os::new_const("windows");
pub const xous: Os = Os::new_const("xous");
Trait Implementations§
source§impl Ord for Os
impl Ord for Os
source§impl PartialOrd<Os> for Os
impl PartialOrd<Os> for Os
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