pub struct QueryPipeline { /* private fields */ }Expand description
Builder and runner for AQL queries.
Wraps all registries and state needed to run queries. Create once,
call query or select many times.
§Example
use amql_engine::{QueryPipeline, ProjectRoot};
let root = ProjectRoot::from(std::path::Path::new("."));
let mut pipeline = QueryPipeline::builder(&root).build();
let results = pipeline.query("route[method=\"GET\"]", "src/").unwrap();Implementations§
Source§impl QueryPipeline
impl QueryPipeline
Sourcepub fn builder(root: &ProjectRoot) -> QueryPipelineBuilder
pub fn builder(root: &ProjectRoot) -> QueryPipelineBuilder
Create a builder pre-loaded with all default resolvers and extractors.
Sourcepub fn query(
&mut self,
selector: &str,
scope: &str,
) -> Result<Vec<QueryResult>, AqlError>
pub fn query( &mut self, selector: &str, scope: &str, ) -> Result<Vec<QueryResult>, AqlError>
Run a unified query (code + annotations) and apply middleware.
Sourcepub fn select(
&self,
selector: &str,
scope: Option<&str>,
) -> Result<Vec<Annotation>, AqlError>
pub fn select( &self, selector: &str, scope: Option<&str>, ) -> Result<Vec<Annotation>, AqlError>
Select annotations by selector (no code parsing).
Sourcepub fn extractors(&self) -> &ExtractorRegistry
pub fn extractors(&self) -> &ExtractorRegistry
Return the extractor registry for this pipeline.
Sourcepub fn root(&self) -> &ProjectRoot
pub fn root(&self) -> &ProjectRoot
Return the project root for this pipeline.
Auto Trait Implementations§
impl Freeze for QueryPipeline
impl !RefUnwindSafe for QueryPipeline
impl Send for QueryPipeline
impl Sync for QueryPipeline
impl Unpin for QueryPipeline
impl UnsafeUnpin for QueryPipeline
impl !UnwindSafe for QueryPipeline
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
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>
Converts
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>
Converts
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