afia-component
A high-level Rust wrapper for
libafia_component.
Overview
This crate provides a higher-level safe API on top of the afia-component-sys
crate.
For instance, creating a new DOM element using the afia-component crate looks like:
use ComponentImports;
let imports = new_dynamically_linked;
let div = imports.create_element.unwrap;
Whereas creating a new DOM element using afia-component-sys requires direct usage of
pointers and unsafe code:
use create_element;
let tag = "div";
let div = unsafe ;
Most developers should choose afia-component since it is easier and safer to use
than the raw afia-component-sys bindings.
A developer might choose to instead use afia-component-sys if they are unsatisfied
with the API that afia-component exposes and would prefer to write their own Rust
wrapper.
To Test
First, download a libafia_component from https://afiaproject.com .
Then run the tests.
Optional Features
emulate-imports- Instead of importing functionality from the Afia host, expose anEmulatedImportsthat can be used to emulate the Afia host.test-utils- Exposes types that are useful for testing.macros- Expose macros such as#[create_instance]and#[output(..)].