Expand description
Convenient, high-performance Rust bindings for RayforceDB v2.
Binds the core ray_* C API directly (via rayforce_sys); see PLAN.md
for the roadmap. The crate is single-threaded by construction: the core runs
on one thread with a thread-local VM and allows a single live Runtime per
process. Runtime::scope brackets it: the closure gets a &Runtime for as
long as it runs, and everything built inside is torn down with it.
rayforce::Runtime::scope(|rt| {
let two = rt.eval("(+ 1 1)")?;
assert_eq!(two.format(), "2");
Ok(())
})Re-exports§
pub use q::QConnection;pub use rayforce_sys as sys;
Modules§
- q
- Q IPC client — connect to a Q server, send a query, get the response decoded
into a rayforce
Value.
Structs§
- Fn
- A compiled RayforceDB lambda function.
- Guid
- Wrapper carrying 16 raw GUID bytes.
- RayError
- An error returned by a RayforceDB operation.
- Runtime
- A live RayforceDB runtime. Obtained only from
Runtime::scope, and only as a shared reference — you cannot own one, so you cannot drop one. - Select
- A
selectquery builder. - Str
- Wrapper that maps a string to a string atom (
-RAY_STR) rather than the default symbol mapping of bare&str. - Table
- A RayforceDB table.
- TcpClient
- A synchronous IPC connection to a RayforceDB server.
- Update
- An
updatequery builder. - Value
- A handle to a RayforceDB object (atom, vector, list, dict, table, …).
- VecIter
- Iterator over a vector’s boxed elements.
Enums§
- Error
Code - A categorized RayforceDB error code (mirrors the core
ray_err_tenum and the short codes carried byRAY_ERRORobjects). - Expr
- A node in the query expression tree.
- Operation
- A RayforceDB builtin operation.
Traits§
- From
Value - Extract a Rust value from a
Value. - Into
Expr - Anything convertible into an
Exproperand: anotherExpr, a literal scalar, or aValue. - ToValue
- Build a
Valuefrom a Rust value. - VecElem
- A fixed-width vector element type, mapping a Rust scalar to a core vector type tag for zero-copy slicing and bulk construction.
Functions§
- avg
- col
- A column / global name reference.
- count
- distinct
- eval
- Evaluate a Rayfall source string. Requires a live
Runtimeon this thread. - eval_
value - Evaluate an already-compiled AST
Value(e.g. a query). Requires a liveRuntimeon this thread. - first
- get_
global - Look up a global binding. Requires a live
Runtimeon this thread. - last
- lit
- A literal value from any
ToValue. - max
- median
- min
- on_
runtime_ thread - Is this the thread that owns the live runtime?
- set_
global - Bind
valueto a global name. Requires a liveRuntimeon this thread. - sum
Type Aliases§
- Result
- Convenience result alias for the crate.