pub enum Target<Value> {
Os(Value),
Family(Value),
Arch(Value),
}Expand description
A cfg condition for targeting an OS, OS family, or architecture. For example:
let function = FunctionDef {
mods: NoOpSeq,
name: Str("conditional_func"),
args: NoOpSeq,
return_type: Str("()"),
where_conds: NoOpSeq,
body: FunctionBodyDeclare
}.with_attributes(
SingularSeq(Cfg(Target::Os(Str("linux"))))
);
let string = InMemoryOutput::print_output(EmptyContext, &function);
assert_eq!("#[cfg(target_os = \"linux\")]\nfn conditional_func() -> ();\n", string);Variants§
Trait Implementations§
Auto Trait Implementations§
impl<Value> Freeze for Target<Value>where
Value: Freeze,
impl<Value> RefUnwindSafe for Target<Value>where
Value: RefUnwindSafe,
impl<Value> Send for Target<Value>where
Value: Send,
impl<Value> Sync for Target<Value>where
Value: Sync,
impl<Value> Unpin for Target<Value>where
Value: Unpin,
impl<Value> UnwindSafe for Target<Value>where
Value: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more