Skip to main content

Crate libperl_macros

Crate libperl_macros 

Source
Expand description

Procedural macros for libperl-rs.

  • #[thx] — function attribute that splices my_perl: *mut PerlInterpreter as the first parameter in threaded builds and is a no-op in non-threaded builds. Lets a single Rust source compile against both MULTIPLICITY modes without manual cfg branches.
  • #[xs_sub] — function attribute that turns a high-level Rust signature like fn is_even(n: IV) -> bool { ... } into a complete XS-callable extern "C" trampoline. (Phase 3.2 — TBD.)
  • xs_boot! — declarative macro that emits the module’s boot_<name> entry. (Phase 3.3 — TBD.)

Threading mode is selected at proc-macro compile time via cfg(perl_useithreads), set by build.rs.

Macros§

xs_boot
xs_boot! — see xs_boot module documentation.

Attribute Macros§

thx
#[thx] — splice my_perl: *mut ::libperl_sys::PerlInterpreter as the first parameter of fn in threaded builds; pass through unchanged in non-threaded builds.
xs_sub
#[xs_sub] — see xs_sub module documentation.