Skip to main content

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