5

proc_macro

 2 years ago
source link: https://doc.rust-lang.org/proc_macro/fn.is_available.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Function proc_macro::is_available1.57.0[−][src]

pub fn is_available() -> bool

Determines whether proc_macro has been made accessible to the currently running program.

The proc_macro crate is only intended for use inside the implementation of procedural macros. All the functions in this crate panic if invoked from outside of a procedural macro, such as from a build script or unit test or ordinary Rust binary.

With consideration for Rust libraries that are designed to support both macro and non-macro use cases, proc_macro::is_available() provides a non-panicking way to detect whether the infrastructure required to use the API of proc_macro is presently available. Returns true if invoked from inside of a procedural macro, false if invoked from any other binary.


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK