Skip to main content

akar_common/
enums.rs

1//! Enumeration types used across Akar.
2
3use serde::{Deserialize, Serialize};
4
5/// Compression algorithm types for column storage.
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
7pub enum CompressionType {
8    Uncompressed,
9    Constant,
10    OneValue,
11    Boolean,
12    IntegerBitpacking,
13    StringDictionary,
14    Float,
15    ListDelta,
16}
17
18/// Transaction action type.
19#[derive(Debug, Clone, Copy, PartialEq, Eq)]
20pub enum TransactionAction {
21    BeginRead,
22    BeginWrite,
23    Commit,
24    Rollback,
25    Checkpoint,
26}
27
28/// Path traversal semantics for variable-length path matching.
29///
30/// Controls what kinds of repetition are allowed when traversing a path:
31/// - `WALK`: No restrictions — nodes and edges may repeat.
32/// - `TRAIL`: Edges may not repeat (but nodes can).
33/// - `ACYCLIC`: Nodes may not repeat (edges automatically won't either).
34#[derive(Debug, Clone, Copy, PartialEq, Eq)]
35pub enum PathSemantic {
36    Walk,
37    Trail,
38    Acyclic,
39}
40
41/// Accumulate type for the LogicalAccumulate operator.
42///
43/// Controls how the accumulate materializes input data:
44/// - `Regular`: Standard materialization (all rows are collected).
45/// - `Optional`: Used for OPTIONAL MATCH — produces a mark indicating
46///   whether at least one row was found.
47#[derive(Debug, Clone, Copy, PartialEq, Eq)]
48pub enum AccumulateType {
49    Regular,
50    Optional,
51}
52
53/// Edge traversal direction for recursive extend.
54#[derive(Debug, Clone, Copy, PartialEq, Eq)]
55pub enum ExtendDirection {
56    /// Forward — follow outgoing edges.
57    Fwd,
58    /// Backward — follow incoming edges.
59    Bwd,
60    /// Both directions.
61    Both,
62}