pub struct Executor { /* private fields */ }Expand description
The main query executor.
Builds an operator tree from a physical plan and executes it to produce results.
Implementations§
Source§impl Executor
impl Executor
Sourcepub fn new(
plan: &PhysicalPlan,
ctx: ExecutionContext,
) -> Result<Self, ParseError>
pub fn new( plan: &PhysicalPlan, ctx: ExecutionContext, ) -> Result<Self, ParseError>
Creates a new executor for the given physical plan.
Sourcepub fn open(&mut self) -> Result<(), ParseError>
pub fn open(&mut self) -> Result<(), ParseError>
Opens the executor and prepares it to produce rows.
Sourcepub fn next(&mut self) -> Result<Option<Row>, ParseError>
pub fn next(&mut self) -> Result<Option<Row>, ParseError>
Returns the next row, or None if there are no more rows.
Sourcepub fn close(&mut self) -> Result<(), ParseError>
pub fn close(&mut self) -> Result<(), ParseError>
Closes the executor and releases resources.
Sourcepub fn context(&self) -> &ExecutionContext
pub fn context(&self) -> &ExecutionContext
Returns the execution context.
Sourcepub fn state(&self) -> OperatorState
pub fn state(&self) -> OperatorState
Returns the current state.
Sourcepub fn execute(&mut self) -> Result<QueryResult, ParseError>
pub fn execute(&mut self) -> Result<QueryResult, ParseError>
Executes the query and collects all results.
Sourcepub fn collect(&mut self) -> Result<Vec<Row>, ParseError>
pub fn collect(&mut self) -> Result<Vec<Row>, ParseError>
Executes and returns just the rows as a vector.
Sourcepub fn count(&mut self) -> Result<usize, ParseError>
pub fn count(&mut self) -> Result<usize, ParseError>
Counts the number of result rows without materializing them.
Auto Trait Implementations§
impl !Freeze for Executor
impl !RefUnwindSafe for Executor
impl Send for Executor
impl !Sync for Executor
impl Unpin for Executor
impl !UnwindSafe for Executor
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