ExecutionContext

Struct ExecutionContext 

Source
pub struct ExecutionContext { /* private fields */ }
Expand description

Execution context for a query.

The context provides access to:

  • Query parameters (bound values for placeholders)
  • Cancellation support
  • Execution statistics
  • Runtime configuration
  • Graph storage access (for graph traversal queries)
  • Vector index access (optional)
  • Collection vector storage access (for named vectors)

Implementations§

Source§

impl ExecutionContext

Source

pub fn new() -> Self

Creates a new execution context without graph storage.

Use with_graph to add graph storage access.

Source

pub fn with_parameters(parameters: HashMap<u32, Value>) -> Self

Creates a context with parameters.

Source

pub fn with_graph(self, graph: Arc<dyn GraphAccessor>) -> Self

Sets the graph accessor for graph traversal operations.

This enables the query executor to perform actual graph traversals using the underlying storage.

Source

pub fn graph(&self) -> &dyn GraphAccessor

Returns a reference to the graph accessor.

Source

pub fn graph_arc(&self) -> Arc<dyn GraphAccessor>

Returns the graph accessor as an Arc.

Source

pub fn with_vector_index_provider( self, provider: Arc<dyn VectorIndexProvider>, ) -> Self

Creates a context with a vector index provider.

Source

pub fn set_vector_index_provider( &mut self, provider: Arc<dyn VectorIndexProvider>, )

Sets the vector index provider.

Source

pub fn vector_index_provider(&self) -> Option<&dyn VectorIndexProvider>

Returns a reference to the vector index provider if one is set.

Source

pub fn vector_index_provider_arc(&self) -> Option<Arc<dyn VectorIndexProvider>>

Returns a clone of the vector index provider Arc if one is set.

This is useful for operators that need to hold onto the provider for the duration of their execution.

Source

pub fn with_collection_vector_provider( self, provider: Arc<dyn CollectionVectorProvider>, ) -> Self

Sets the collection vector provider for named vector storage.

Source

pub fn set_collection_vector_provider( &mut self, provider: Arc<dyn CollectionVectorProvider>, )

Sets the collection vector provider.

Source

pub fn collection_vector_provider( &self, ) -> Option<&dyn CollectionVectorProvider>

Returns a reference to the collection vector provider if one is set.

Source

pub fn collection_vector_provider_arc( &self, ) -> Option<Arc<dyn CollectionVectorProvider>>

Returns a clone of the collection vector provider Arc if one is set.

Source

pub fn set_parameter(&mut self, index: u32, value: Value)

Adds a parameter value.

Source

pub fn get_parameter(&self, index: u32) -> Option<&Value>

Gets a parameter value.

Source

pub fn parameters(&self) -> &HashMap<u32, Value>

Returns all parameters.

Source

pub fn cancel(&self)

Cancels the query execution.

Source

pub fn is_cancelled(&self) -> bool

Checks if the query has been cancelled.

Source

pub fn stats(&self) -> &ExecutionStats

Returns the execution statistics.

Source

pub fn config(&self) -> &ExecutionConfig

Returns the configuration.

Source

pub fn config_mut(&mut self) -> &mut ExecutionConfig

Returns mutable configuration.

Source

pub fn record_rows_read(&self, count: u64)

Records that rows were read.

Source

pub fn record_rows_produced(&self, count: u64)

Records that rows were produced.

Source

pub fn record_rows_filtered(&self, count: u64)

Records that rows were filtered.

Source

pub fn with_config(self, config: ExecutionConfig) -> Self

Sets the execution configuration.

Source

pub fn max_rows_in_memory(&self) -> usize

Returns the maximum rows in memory limit.

Returns 0 if the limit is disabled.

Trait Implementations§

Source§

impl Debug for ExecutionContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExecutionContext

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more