pub struct QueryEngine<'a> { /* private fields */ }Expand description
Query engine for traceability operations.
Implementations§
Source§impl<'a> QueryEngine<'a>
impl<'a> QueryEngine<'a>
Sourcepub fn new(graph: &'a KnowledgeGraph) -> Self
pub fn new(graph: &'a KnowledgeGraph) -> Self
Creates a new query engine.
Sourcepub fn lookup(&self, id: &str) -> LookupResult<'a>
pub fn lookup(&self, id: &str) -> LookupResult<'a>
Looks up an item by ID.
If the item is not found, returns suggestions for similar IDs.
Sourcepub fn trace_upstream(
&self,
id: &ItemId,
options: &TraversalOptions,
) -> Option<TraversalResult>
pub fn trace_upstream( &self, id: &ItemId, options: &TraversalOptions, ) -> Option<TraversalResult>
Queries the upstream traceability chain for an item.
Sourcepub fn trace_downstream(
&self,
id: &ItemId,
options: &TraversalOptions,
) -> Option<TraversalResult>
pub fn trace_downstream( &self, id: &ItemId, options: &TraversalOptions, ) -> Option<TraversalResult>
Queries the downstream traceability chain for an item.
Sourcepub fn items_by_type(&self, item_type: ItemType) -> Vec<&'a Item>
pub fn items_by_type(&self, item_type: ItemType) -> Vec<&'a Item>
Gets all items by type.
Sourcepub fn graph(&self) -> &'a KnowledgeGraph
pub fn graph(&self) -> &'a KnowledgeGraph
Returns the graph reference.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for QueryEngine<'a>
impl<'a> RefUnwindSafe for QueryEngine<'a>
impl<'a> Send for QueryEngine<'a>
impl<'a> Sync for QueryEngine<'a>
impl<'a> Unpin for QueryEngine<'a>
impl<'a> UnwindSafe for QueryEngine<'a>
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> 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>
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