Using Rust’s Foreign Function Interface (FFI) with C!
Show NotesThe code samples here directly match the things I described in the show, so you will likely want to look at add and ffi::add, then Point, translate, and ffi::translate in that order.
LinksOther helpful Rust FFI discussions:
The Rust Programming Language’s materials the nomicon Rust FFI Omnibus the Reference’s discussion the associated Rust API docs SponsorsThanks to Manning for sponsoring the show and giving all of you a 40%-off discount on their whole store (but especially Carol Nichols’ and Jake Goulding’s Rust in Motion video content and the Rust in Action MEAP!) at deals.manning.com/new-rustacean
Patreon Sponsors Adam Green Aleksey Pirogov Alexander Kryvomaz Alexander Lozada Alexander Payne Andrew Dirksen Andrew Thompson Anthony Deschamps Anthony Scotti Arlen Haftevani Arlo (Hyena) Arun Kulshreshtha Behnam Esfahbod Benjamin Manns Benjamin Wasty Brandon ‘Spanky’ Mills Brian Casiello Brian Manning Brian McCallister Bryan Stitt Caryn Finkelman Cass Costello Cat Dad Chap Lovejoy Charlie Egan Chip Chris Palmer Christoffer Ceutz Dan Abrams Daniel Daniel Bross Daniel Collin Daniel Mason David Carroll David Hewson Derek Morr Doug Reeves Douglas Correa Edmund Kump Eduard Knyshov Embark Studios Eugene Bulkin Evan Stoll Fabio (decathorpe) Fabio Correa Gaveen Prabhasara Graham Wihlidal Henri Sivonen Ian Jones Hoàng Đức Hiếu Hugo Josefson “Jake”“ferris”" Taylor" Jako Danar James Cooper James Hagans II Jason Bowen Jendrik Illner Jerome Froelich Joar Wandborg Johan Andersson John Rudnick Jon Jonah Jonathan Knapp Jonathan Turner Joseph Hain Joseph Mou Joseph Schrag Joe Percy Justin Ossevoort Kai Yao Kazutaka Mise Keith Gray Kilian Rault Lee Jenkins Luca Schmid Luiz Irber Lukas Eller Malnormalulo Martin Heuschober Masashi Fujita Matt Rudder Matthew Brenner Matthias Ruszala Max Jacobson Max R.R. Collada Messense Lv Micael Bergeron Michael Mc Donnell Michael Melanson Michael Sanders Nathan Sculli Nick Coish Nick Gideo Nick Stevens Nicolas Pochet Oladapo Fadeyi Olaf Leidinger(Thanks to the couple people donating who opted out of the reward tier, as well. You know who you are!)
Become a sponsor Patreon Venmo Dwolla Cash.me Flattr PayPal.me Contact New Rustacean: + Twitter: @newrustacean + Email: hello@newrustacean.com Chris Krycho + GitHub: chriskrycho + Twitter: @chriskrycho
Create your
podcast in
minutes
It is Free