pub struct PipelineExecutor { /* private fields */ }Expand description
Pipeline executor for document indexing.
Uses PipelineOrchestrator internally for stage management.
Supports both preset configurations and custom stage pipelines.
§Example
// Default pipeline
let executor = PipelineExecutor::new();
let result = executor.execute(input, options).await?;
// With LLM enhancement
let executor = PipelineExecutor::with_llm(client);
// Custom pipeline using orchestrator
let orchestrator = PipelineOrchestrator::new()
.stage(ParseStage::new())
.stage_with_priority(MyCustomStage::new(), 50)
.stage(BuildStage::new());
let executor = PipelineExecutor::from_orchestrator(orchestrator);Implementations§
Source§impl PipelineExecutor
impl PipelineExecutor
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new pipeline executor with default stages.
Default stages (in order):
parse- Parse document into raw nodesbuild- Build tree structureenrich- Add metadata and cross-referencesoptimize- Optimize tree structure
Sourcepub fn with_llm(client: LlmClient) -> Self
pub fn with_llm(client: LlmClient) -> Self
Create a pipeline with LLM enhancement.
Stages (in order):
parse- Parse documentbuild- Build treeenhance- LLM-based enhancement (summaries)enrich- Add metadataoptimize- Optimize tree
Sourcepub fn from_orchestrator(orchestrator: PipelineOrchestrator) -> Self
pub fn from_orchestrator(orchestrator: PipelineOrchestrator) -> Self
Create from a custom orchestrator.
Use this for full control over stage ordering and dependencies.
§Example
let orchestrator = PipelineOrchestrator::new()
.stage_with_priority(ParseStage::new(), 10)
.stage_with_priority(MyAnalysisStage::new(), 25)
.stage_with_priority(BuildStage::new(), 20)
.stage_with_deps(MyValidationStage::new(), 50, &["build"]);
let executor = PipelineExecutor::from_orchestrator(orchestrator);Sourcepub fn add_stage(self, stage: impl IndexStage + 'static) -> Self
pub fn add_stage(self, stage: impl IndexStage + 'static) -> Self
Add a stage with default priority.
The stage will be added after existing stages with the same priority.
Sourcepub fn add_stage_with_priority(
self,
stage: impl IndexStage + 'static,
priority: i32,
) -> Self
pub fn add_stage_with_priority( self, stage: impl IndexStage + 'static, priority: i32, ) -> Self
Add a stage with custom priority.
Lower priority = earlier execution.
Sourcepub fn add_stage_with_deps(
self,
stage: impl IndexStage + 'static,
priority: i32,
depends_on: &[&str],
) -> Self
pub fn add_stage_with_deps( self, stage: impl IndexStage + 'static, priority: i32, depends_on: &[&str], ) -> Self
Add a stage with priority and dependencies.
The stage will run after all specified dependencies.
Sourcepub fn with_persistence(self, workspace: Workspace) -> Self
pub fn with_persistence(self, workspace: Workspace) -> Self
Add persistence stage with workspace.
Sourcepub fn stage_names(&self) -> Result<Vec<&str>>
pub fn stage_names(&self) -> Result<Vec<&str>>
Get the list of stage names in execution order.
Sourcepub fn stage_count(&self) -> usize
pub fn stage_count(&self) -> usize
Get the number of stages.
Sourcepub async fn execute(
&mut self,
input: IndexInput,
options: PipelineOptions,
) -> Result<IndexResult>
pub async fn execute( &mut self, input: IndexInput, options: PipelineOptions, ) -> Result<IndexResult>
Execute the pipeline.
Stages are executed in dependency-resolved order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PipelineExecutor
impl !RefUnwindSafe for PipelineExecutor
impl Send for PipelineExecutor
impl Sync for PipelineExecutor
impl Unpin for PipelineExecutor
impl UnsafeUnpin for PipelineExecutor
impl !UnwindSafe for PipelineExecutor
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more