reifydb_engine/vm/mod.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2025 ReifyDB
3
4//! Virtual machine that executes the instruction stream emitted by the planner. The VM owns the per-request
5//! lifecycle (admin, command, query, subscription), threads parameters through, walks the plan, dispatches each
6//! instruction to its handler, and returns the resulting columns or change deltas to the caller.
7//!
8//! Instruction handlers live alongside the VM so the dispatch table is the single place that decides what an
9//! opcode does. Adding a new instruction means writing a handler and wiring it in - planner output never reaches
10//! storage without first being interpreted here.
11
12use reifydb_type::params::Params;
13
14#[derive(Debug)]
15pub struct Admin<'a> {
16 pub rql: &'a str,
17 pub params: Params,
18}
19
20#[derive(Debug)]
21pub struct Command<'a> {
22 pub rql: &'a str,
23 pub params: Params,
24}
25
26#[derive(Debug)]
27pub struct Query<'a> {
28 pub rql: &'a str,
29 pub params: Params,
30}
31
32#[derive(Debug)]
33pub struct Subscription<'a> {
34 pub rql: &'a str,
35 pub params: Params,
36}
37
38#[derive(Debug)]
39pub struct Test<'a> {
40 pub rql: &'a str,
41 pub params: Params,
42}
43
44pub(crate) mod exec;
45pub mod executor;
46pub mod instruction;
47pub mod services;
48pub mod stack;
49#[allow(clippy::module_inception)]
50pub mod vm;
51pub mod volcano;