pub struct QueryResult {
pub nodes: Vec<u64>,
pub scores: Vec<f32>,
pub embeddings: Option<Vec<Vec<f32>>>,
pub attention_weights: Option<Vec<Vec<f32>>>,
pub subgraph: Option<SubGraph>,
pub latency_ms: u64,
}Expand description
Query result with nodes, scores, and optional metadata
Fields§
§nodes: Vec<u64>Matched node IDs
scores: Vec<f32>Similarity scores (higher = more similar)
embeddings: Option<Vec<Vec<f32>>>Optional node embeddings after GNN processing
attention_weights: Option<Vec<Vec<f32>>>Optional attention weights from differentiable search
subgraph: Option<SubGraph>Optional subgraph extraction
latency_ms: u64Query latency in milliseconds
Implementations§
Source§impl QueryResult
impl QueryResult
Sourcepub fn with_embeddings(self, embeddings: Vec<Vec<f32>>) -> Self
pub fn with_embeddings(self, embeddings: Vec<Vec<f32>>) -> Self
Add embeddings to the result
Sourcepub fn with_attention(self, attention: Vec<Vec<f32>>) -> Self
pub fn with_attention(self, attention: Vec<Vec<f32>>) -> Self
Add attention weights to the result
Sourcepub fn with_subgraph(self, subgraph: SubGraph) -> Self
pub fn with_subgraph(self, subgraph: SubGraph) -> Self
Add subgraph to the result
Sourcepub fn with_latency(self, latency_ms: u64) -> Self
pub fn with_latency(self, latency_ms: u64) -> Self
Set query latency
Sourcepub fn filter_by_score(self, min_score: f32) -> Self
pub fn filter_by_score(self, min_score: f32) -> Self
Filter results by minimum score
Trait Implementations§
Source§impl Clone for QueryResult
impl Clone for QueryResult
Source§fn clone(&self) -> QueryResult
fn clone(&self) -> QueryResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QueryResult
impl Debug for QueryResult
Source§impl Default for QueryResult
impl Default for QueryResult
Source§impl<'de> Deserialize<'de> for QueryResult
impl<'de> Deserialize<'de> for QueryResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for QueryResult
impl RefUnwindSafe for QueryResult
impl Send for QueryResult
impl Sync for QueryResult
impl Unpin for QueryResult
impl UnwindSafe for QueryResult
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