Skip to main content

Crate fre_rs

Crate fre_rs 

Source
Expand description

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

§Getting Started

The primary entry points of this crate are the macros extension! and function!. Refer to their documentation for details and examples.

§Flash Runtime Extension Lifecycle

                                  Flash-Runtime ━━━━┓
                                                    ┃
         ExtensionContext.loadExtension ━━━━━━━━━━━━┫
               ↓                                    ┃
   ┏━━━━ Extension-Load ━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
   ┃           ↓                                    ┃
   ┃     Initializer → Extension-Data               ┃
   ┃           ↓                                    ┃
   ┃  ┏━━ ExtensionContext.createExtensionContext ━━┫
   ┃  ┃        ↓                                    ┃
   ┃  ┃    Context-Initializer → Context-Data       ┃
   ┃  ┃        ↓            ↓    ↓         ↓        ┃
   ┃  ┃    Function-Data → Function  Extension-Data ┃
   ┃  ┃                     ↑                       ┃
   ┃  ┣━━ ExtensionContext.call ━━━━━━━━━━━━━━━━━━━━┫
   ┃  ┃                                             ┃
   ┃  ┃                        Extension-Data       ┃
   ┃  ┃                              ↑              ┃
   ┃  ┃    Context-Data ≈ `ContextRegistry`         ┃
   ┃  ┃        ↓                     ↑              ┃
   ┃  ┃    Context-Finalizer    Function-Data       ┃
   ┃  ┃        ↑                                    ┃
   ┃  ┗━━ ExtensionContext.dispose ━━━━━━━━━━━━━━━━━┫
   ┃                                                ┃
   ┃            Extension-Data → Finalizer          ┃
   ┃                                 ↑              ┃
   ┗━━━━━━━━━━━━━━━━━━━━━━━━━━ Extension-Unload ━━━━┛

Modules§

as3
Namespace for ActionScript 3 object types.
c
fre-sys
context
Core implementation of the extension abstraction.
data
This module provides safe conversions between concrete typed instances and raw pointers for native data.
error
event
Asynchronous event dispatching utilities for cross-thread scenarios, providing a safe interface for interacting with the Flash Runtime.
function
misc
Miscellaneous items that do not yet have a clear module placement. Their current structure is not ideal and may be refactored as the crate evolves or as the underlying ANE C API improves.
prelude
types
Abstractions over ActionScript objects for integration with its type system.
utils
validated
Validated types for safe interaction with the C API and the Flash Runtime, ensuring data passed across the FFI boundary is well-formed and valid.

Macros§

extension
Generates and links the required Flash Runtime Extension entry points and lifecycle hooks, bridging the C ABI with safe Rust abstractions.
function
Defines a function intended for context registration by generating its ABI-compatible wrapper and binding it to a Rust implementation.