Expand description
Author-facing crate for Reflow actor packs.
ⓘ
use reflow_pack_sdk::{reflow_pack, PackHost};
use std::sync::Arc;
struct Hello;
impl reflow_pack_sdk::Actor for Hello { /* … */ }
#[reflow_pack]
fn register(host: &mut PackHost) {
host.register("my.pack.hello", || Arc::new(Hello));
}A pack crate needs exactly one dep (reflow_pack_sdk), sets crate-type = ["cdylib"], and is built with the same rustc version as the host
runtime it targets.
Structs§
- Actor
Context - Actor
Load - Memory
State - Pack
Actor Handle - Opaque actor handle the pack hands back from its factory. Layout is
deliberately not
#[repr(C)]—Arc<dyn Actor>is a Rust fat pointer whose vtable layout depends on the compiler. Lockstep-toolchain packs share this layout because they link against the samereflow_actorcrate and the same rustc. - Pack
Host - Safe wrapper handed to user code by the macro-emitted entrypoint. It buffers registration calls and reports the final status back.
- Pack
Host Vtable - Vtable passed into
reflow_pack_register(host: *mut rfl_pack_host).
Enums§
- Message
- Pack
Register Status - Status code returned by
rfl_pack_host::register_template.
Constants§
- REFLOW_
PACK_ ABI_ VERSION - ABI version the host was built with. Packs must emit the same value
from their
reflow_pack_abi_versionsymbol.
Traits§
Type Aliases§
- Actor
Behavior - Type-erased actor body. The closure produces a future that resolves to the actor’s port outputs.
- Actor
Payload - Pack
Factory Drop Fn - Drop: called by the host when the pack is unloaded, so the pack can
release any heap memory it stashed in
factory_user_data. - Pack
Factory Fn - Factory: produces a fresh actor instance per node. Mirrors
Actor::create_instance. - Port
Attribute Macros§
- reflow_
pack - Mark a function as the pack’s registration entrypoint.