Skip to main content

oxirs_arq/executor/
types.rs

1//! Auto-generated module
2//!
3//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
4
5use crate::algebra::Solution;
6
7/// Function registry for custom functions
8#[derive(Debug, Clone)]
9pub struct FunctionRegistry {}
10impl FunctionRegistry {
11    pub fn new() -> Self {
12        Self {}
13    }
14}
15/// Access path selection for pattern execution
16#[derive(Debug, Clone, Copy)]
17pub enum AccessPath {
18    SubjectIndex,
19    PredicateIndex,
20    ObjectIndex,
21    FullScan,
22}
23/// Query execution strategy
24#[derive(Debug, Clone, Copy, Default)]
25pub enum ExecutionStrategy {
26    /// Always use serial execution
27    Serial,
28    /// Always use parallel execution
29    Parallel,
30    /// Use streaming execution for large results
31    Streaming,
32    /// Adaptive strategy based on query characteristics
33    #[default]
34    Adaptive,
35}
36/// Cached result for query caching
37#[derive(Debug, Clone)]
38pub struct CachedResult {
39    pub solution: Solution,
40    pub timestamp: std::time::Instant,
41}
42
43/// Error raised when a SPARQL expression references a function the engine does
44/// not implement.
45///
46/// This is a distinct typed error so filter / `HAVING` row-evaluation loops can
47/// tell it apart from ordinary per-row evaluation errors. An unknown function is
48/// a whole-query fault that must fail loud — silently dropping the offending
49/// rows would return a `200 OK` with a wrongly-shrunk (or empty) result set,
50/// violating the no-silent-empty contract. By contrast, a type error on a single
51/// row (SPARQL 1.1 §17.3) merely excludes that row and is not an
52/// `UnknownFunctionError`.
53///
54/// Raise it wrapped in [`anyhow::Error`] and recover it with
55/// `err.downcast_ref::<UnknownFunctionError>()`. Its `Display` reproduces the
56/// engine's long-standing `"Unknown function: {name}"` text.
57#[derive(Debug, Clone, PartialEq, Eq)]
58pub struct UnknownFunctionError(pub String);
59
60impl std::fmt::Display for UnknownFunctionError {
61    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
62        write!(f, "Unknown function: {}", self.0)
63    }
64}
65
66impl std::error::Error for UnknownFunctionError {}