Skip to main content

Crate reflow_pack_sdk

Crate reflow_pack_sdk 

Source
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§

ActorContext
ActorLoad
MemoryState
PackActorHandle
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 same reflow_actor crate and the same rustc.
PackHost
Safe wrapper handed to user code by the macro-emitted entrypoint. It buffers registration calls and reports the final status back.
PackHostVtable
Vtable passed into reflow_pack_register(host: *mut rfl_pack_host).

Enums§

Message
PackRegisterStatus
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_version symbol.

Traits§

Actor
ActorState

Type Aliases§

ActorBehavior
Type-erased actor body. The closure produces a future that resolves to the actor’s port outputs.
ActorPayload
PackFactoryDropFn
Drop: called by the host when the pack is unloaded, so the pack can release any heap memory it stashed in factory_user_data.
PackFactoryFn
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.