fre-rs 0.1.0

Safe, ergonomic Rust abstraction over the AIR Native Extension (ANE) C API (`fre-sys`) for native-side development.
Documentation

fre-rs

Safe, ergonomic Rust abstraction over the AIR Native Extension (ANE) C API (fre-sys) for native-side development.

This crate depends on the AIR SDK via fre-sys. See its documentation for setup instructions.

References

Safety

This crate provides safe abstractions over the ANE C API.

Underlying objects may still be modified externally by the AIR runtime.

Unsafe code is minimized and encapsulated, but correct usage of this crate's API is still required.

License

MIT OR Apache-2.0

Getting Started

The primary entry points of this crate are the macros [extension!] and [function!].

Refer to their documentation for details and examples.

Example

use fre_rs::prelude::*;
fre_rs::extension! {
    extern symbol_initializer;
    gen context_initializer, final;
}
fn context_initializer(frt: &FlashRuntime) -> FunctionSet {
    let mut funcs = FunctionSet::new();
    funcs.add(None, None::<()>, method_name);
    funcs
}
fre_rs::function! {
    method_name (frt, _, args) -> StringObject {
        frt.trace(args);
        StringObject::new(frt, "Hello! Flash Runtime")
    }
}