More for the fun of my own, personal enjoyment I spent this evening
tackling a Rust binding for the Sword library. I doubt it will go much of
anywhere, but I was able to get it to a point where it will instantiate an
SWMgr, list the installed modules, return a specific module, allow you to
set the module key (by text only), and retrieve the stripped text of the
module entry.

To prove it was doing the thing I thought, I added a little CLI that does
exactly that - iterate all installed modules, try setting them to a random
verse in John 3:1-20, and print the stripText results to the console.

If you're curious about what the code looks like:
https://src.thehellings.com/greg/sword_rs

This was pretty much just an excuse to learn how to link Rust and C++. It's
probably ugly on both sides of the FFI boundary, but it works!

--Greg
_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Reply via email to