pub struct SearchResult {
pub file_path: PathBuf,
pub line_start: u32,
pub line_end: u32,
pub snippet: String,
pub score: f64,
pub language: Option<String>,
}Expand description
A result from semantic code search.
§Examples
use argus_core::SearchResult;
use std::path::PathBuf;
let result = SearchResult {
file_path: PathBuf::from("src/db.rs"),
line_start: 10,
line_end: 25,
snippet: "fn connect() { ... }".into(),
score: 0.92,
language: Some("rust".into()),
};
assert!(result.score > 0.9);Fields§
§file_path: PathBufPath to the file containing the match.
line_start: u32First line of the matched snippet.
line_end: u32Last line of the matched snippet.
snippet: StringThe matched code snippet.
score: f64Relevance score (0.0–1.0).
language: Option<String>Detected language of the snippet.
Trait Implementations§
Source§impl Clone for SearchResult
impl Clone for SearchResult
Source§fn clone(&self) -> SearchResult
fn clone(&self) -> SearchResult
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 SearchResult
impl Debug for SearchResult
Source§impl<'de> Deserialize<'de> for SearchResult
impl<'de> Deserialize<'de> for SearchResult
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 SearchResult
impl RefUnwindSafe for SearchResult
impl Send for SearchResult
impl Sync for SearchResult
impl Unpin for SearchResult
impl UnsafeUnpin for SearchResult
impl UnwindSafe for SearchResult
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