afia-component-sys
A low-level Rust wrapper for
libafia_component.
Overview
libafia_component is a static library that provides a C interface for implementing and testing Afia site components.
It can be downloaded from https://afiaproject.com .
The afia-component-sys crate wraps libafia_component in a low-level Rust interface.
For example, this crate exposes libafia_component's create_element function like so:
// Links to `libafia_component` and re-exports its `create_element` function
// as a Rust function.
extern "C"
Adding Bindings
As a starting point, we are adding bindings by hand. Bindings are written in src/lib.rs.
In the future, Afia distributions will include header files and JSON files that describe the libafia_component
interface.
After that we can explore automatically generating afia-component-sys's bindings.
In the future, after Afia we can explore automatically generating these bindings.
To Test
Optional Features
emulate-imports- Instead of importing functionality from the Afia host, expose anEmulatedImportsthat can be used to emulate the Afia host. Useful when testing a component.test-utils- Exposes types that are useful for testing.