pub struct StoreContext<'a> { /* private fields */ }Expand description
The store-backed context for one repo.
Implementations§
Source§impl<'a> StoreContext<'a>
impl<'a> StoreContext<'a>
Sourcepub fn new(
conn: &'a Connection,
repo_id: &str,
semantic: HashMap<String, SemanticVec>,
) -> Self
pub fn new( conn: &'a Connection, repo_id: &str, semantic: HashMap<String, SemanticVec>, ) -> Self
A context over conn scoped to repo_id, with the query phrases’
vectors for semantic(...) (empty when no provider ran).
Sourcepub fn with_rows_root(self, rows: Vec<Value>) -> Self
pub fn with_rows_root(self, rows: Vec<Value>) -> Self
Serve rows — target-tagged store rows a plan produced — as the
oqx::ROWS_ROOT scan (the residual query’s source). Every other
root and every relation, intrinsic and row function still hits the
store, so the residual sees exactly what a full scan would.
Sourcepub fn take_root_failure(&self) -> Option<OqxError>
pub fn take_root_failure(&self) -> Option<OqxError>
The store failure a root scan hit during the run, if any. Every other
read fails through the engine’s channel (get / call_method return
Err); root has none, so it serves an empty scan and leaves the
failure here for the runner to report.
Trait Implementations§
Source§impl DataContext for StoreContext<'_>
impl DataContext for StoreContext<'_>
Source§fn root(&self, name: &str) -> Value
fn root(&self, name: &str) -> Value
Resolve a named root (the
from <name> source / directive receiver).
Unknown names are Value::Undefined.Source§fn get(&self, row: &Value, key: &str) -> Result<Value>
fn get(&self, row: &Value, key: &str) -> Result<Value>
Read a property/relation off a row: a bare identifier (
field), a
.field segment, or a ^field outer reference all come through here,
each against exactly the row of the scope it names. An absent property
is Ok(Value::Undefined); the engine never looks elsewhere for it. Read moreSource§fn identity(&self, row: &Value) -> Value
fn identity(&self, row: &Value) -> Value
Identity of a row for
follow cycle detection / dedup and for
distinct over unprojected rows.Source§fn call_function(&self, name: &str, args: &[Value]) -> Option<Result<Value>>
fn call_function(&self, name: &str, args: &[Value]) -> Option<Result<Value>>
Optional custom free function.
None = not handled: the engine falls
back to the builtin table, then errors if that has no such function.Source§fn regex_dialect(&self) -> RegexDialect
fn regex_dialect(&self) -> RegexDialect
The regex dialect
matches() compiles against. RegexDialect::Oqx
(the default) is the portable baseline the spec tests;
RegexDialect::Native hands the pattern to the regex crate as is —
implementation-defined, not portable. The engine dispatches matches
through DataContext::call_method, so this is read by the context’s
own matches (DefaultContext does, via
crate::semantics::builtin_method_with); plain
crate::semantics::builtin_method is always the baseline.Auto Trait Implementations§
impl<'a> !Freeze for StoreContext<'a>
impl<'a> !RefUnwindSafe for StoreContext<'a>
impl<'a> !Send for StoreContext<'a>
impl<'a> !Sync for StoreContext<'a>
impl<'a> !UnwindSafe for StoreContext<'a>
impl<'a> Unpin for StoreContext<'a>
impl<'a> UnsafeUnpin for StoreContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more