macsixc / rust-libloading-example

A design pattern for shared library loading in Rust with versioned vtables and owned symbols

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repository contains an example design pattern for interfacing with C-language plugins through Rust. It works on UNIX-based systems only.

For an explanation of the code, see the corresponding blog post at http://kmdouglass.github.io/posts/a-simple-plugin-interface-for-the-rust-ffi/

Instructions

First, from the root of this repository, build the example C library:

$ cd ffi-test
$ make

Next, build the Rust binary and run it:

$ cd ..
$ cargo build
$ cargo run

Commit history

The commit history contains earlier attempts at creating this design. Some of these attempts will not compile.

About

A design pattern for shared library loading in Rust with versioned vtables and owned symbols

License:MIT License


Languages

Language:Rust 64.6%Language:C 31.3%Language:Makefile 4.1%