Enum cfg_expr::expr::TargetPredicate [−][src]
pub enum TargetPredicate<'a> { Arch(Arch<'a>), Endian(Endian), Env(Env<'a>), Family(Family), Os(Os<'a>), PointerWidth(u8), Vendor(Vendor<'a>), }
Expand description
All predicates that pertains to a target, except for target_feature
Variants
Tuple Fields of Arch
0: Arch<'a>
Tuple Fields of Endian
0: Endian
Tuple Fields of Env
0: Env<'a>
target_family
This also applies to the bare unix
and windows
predicates.
Tuple Fields of Family
0: Family
Tuple Fields of Os
0: Os<'a>
Tuple Fields of PointerWidth
0: u8
Tuple Fields of Vendor
0: Vendor<'a>
Implementations
Returns true of the predicate matches the specified target
use cfg_expr::{targets::*, expr::TargetPredicate as tp}; let win = get_builtin_target_by_triple("x86_64-pc-windows-msvc").unwrap(); assert!( tp::Arch(Arch::x86_64).matches(win) && tp::Endian(Endian::little).matches(win) && tp::Env(Env::msvc).matches(win) && tp::Family(Family::windows).matches(win) && tp::Os(Os::windows).matches(win) && tp::PointerWidth(64).matches(win) && tp::Vendor(Vendor::pc).matches(win) );
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<'a> RefUnwindSafe for TargetPredicate<'a>
impl<'a> Send for TargetPredicate<'a>
impl<'a> Sync for TargetPredicate<'a>
impl<'a> Unpin for TargetPredicate<'a>
impl<'a> UnwindSafe for TargetPredicate<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more