Module::Build::FFI::Rust - Build Perl extensions in Rust with FFI
Module::Build::FFI variant for writing Perl extensions in Rust wiht FFI (sans XS).
All methods, properties and actions are inherited from:
Module::Build::FFI
Currently the Rust compile and link is done in one command so these are both provided to that one step.
Extra compiler flags to be passed to rustc.
rustc
Must be a array reference.
Extra linker flags to be passed to rustc.
my $has_compiler = $mb->ffi_have_compiler;
Returns true if a rust compiler (rustc) is available.
my $dll_path = $mb->ffi_build_dynamic_lib($src_dir, $name, $target_dir); my $dll_path = $mb->ffi_build_dynamic_lib($src_dir, $name);
Compiles the Rust source in the $src_dir and link it into a dynamic library with base name of $name.$Config{dlexe}. If $target_dir is specified then the dynamic library will be delivered into that directory.
$src_dir
$name.$Config{dlexe}
$target_dir
For a complete example working example, see this module which calculates fibonacci numbers using Rust.
https://github.com/plicease/Fibonacci-FFI
If something does not work as advertised, or the way that you think it should, or if you have a feature request, please open an issue on this project's GitHub issue tracker:
https://github.com/plicease/FFI-Platypus-Lang-Rust/issues
If you have implemented a new feature or fixed a bug then you may make a pull reequest on this project's GitHub repository:
Caution: if you do this too frequently I may nominate you as the new maintainer. Extreme caution: if you like that sort of thing.
The Core Platypus documentation.
General MB class for FFI / Platypus.
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2015 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install FFI::Platypus::Lang::Rust, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FFI::Platypus::Lang::Rust
CPAN shell
perl -MCPAN -e shell install FFI::Platypus::Lang::Rust
For more information on module installation, please visit the detailed CPAN module installation guide.