ff_script/lib.rs
1//! Typed FCALL wrappers and Lua library loader for FlowFabric Valkey Functions.
2
3#[macro_use]
4pub mod macros;
5pub mod engine_error_ext;
6pub mod error;
7pub mod result;
8pub mod loader;
9pub mod retry;
10pub mod functions;
11pub mod stream_tail;
12
13pub use error::ScriptError;
14pub use retry::{is_retryable_kind, kind_to_stable_str};
15
16/// The compiled FlowFabric Lua library source.
17///
18/// Generated from `lua/*.lua` by `scripts/gen-ff-script-lua.sh` and checked
19/// into the crate as `flowfabric.lua` so it ships inside the published
20/// tarball. CI (`matrix.yml`) fails if this file drifts from what the
21/// script would produce.
22pub const LIBRARY_SOURCE: &str = include_str!("flowfabric.lua");
23
24/// Expected library version. Must match `FCALL ff_version 0` return.
25///
26/// **Single source of truth is `lua/version.lua`.** The gen script
27/// extracts the `return 'X'` literal and writes it to
28/// `flowfabric_lua_version`. Bump `lua/version.lua` whenever any Lua
29/// function's KEYS or ARGV arity changes, or a new function is added.
30pub const LIBRARY_VERSION: &str = include_str!("flowfabric_lua_version");
31
32// Re-export the trait so callers can use it without reaching into result.
33pub use result::FromFcallResult;