diff --git a/README.md b/README.md index c608542..8bee331 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,6 @@ Pending Changes before 1.0 files, we only need to call bootstrap functions after all. (So we may not even need to parse the rust code, rather, just provide a list of perl packages to create...) -* Add prototypes to exported functions. -* Allow "trailing" `Option` parameters to be skipped in perl. - eg. `fn foo(x: u32, y: Option);` should be callable as `foo(1)`, rather than requiring - `foo(1, undef)`. Current recommended usage. ========================== diff --git a/perlmod/src/lib.rs b/perlmod/src/lib.rs index 55f0d96..e23d2f9 100644 --- a/perlmod/src/lib.rs +++ b/perlmod/src/lib.rs @@ -70,9 +70,21 @@ pub use perlmod_macro::package; /// Attribute to export a function so that it can be installed as an `xsub` in perl. See the /// [`package!`](macro@package) macro for a usage example. /// -/// This macro can optionally take a `raw_return` argument specifying that the return type, which -/// must be a [`Value`], will be returned as is, and not go through serialization. As of perlmod -/// 0.6, serialization of a [`Value`] will not produce a clone, so this is mostly an optimization. +/// This macro has the following optional arguments: +/// +/// * `raw_return`: specifies that the return type, which must be a [`Value`], will be returned as +/// is, and not go through serialization. As of perlmod +/// 0.6, serialization of a [`Value`] will not produce a clone, so this is mostly an +/// optimization. +/// * `prototype`: The perl prototype for the function. By default, this will be guessed from the +/// parameters as a chain of '$', with trailing `Option<>` parameters behind a `;`. So for +/// example, an `fn(i32, Option, i32, Option)` has the prototype `$$$;$`. +/// * `xs_name`: override the name of the exported xsub, this is not recommended and only makes +/// sense when *not* using the `#[package]` macro, as with the `#[package]` macro, these aren't +/// publicly visible. +/// * `name`: the name the function should be using in perl. This only makes sense with the +/// `#[package]` macro, as otherwise the user is responsible for loading the function via perl's +/// `DynaLoader` on their own. /// /// Additionally, function parameters can also use the following attributes: ///