Skip to main content

StoreContext

Struct StoreContext 

Source
pub struct StoreContext<'a> { /* private fields */ }
Expand description

The store-backed context for one repo.

Implementations§

Source§

impl<'a> StoreContext<'a>

Source

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).

Source

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.

Source

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<'_>

Source§

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>

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 more
Source§

fn to_rows(&self, value: &Value) -> Vec<Value>

Coerce a relation/source value into rows.
Source§

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>>

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 call_method( &self, name: &str, recv: &Value, args: &[Value], ) -> Option<Result<Value>>

Optional custom method (recv.name(args)). None = not handled, as for DataContext::call_function.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.