pub struct VectorSearchResult {
pub id: u64,
pub collection: String,
pub distance: f32,
pub vector: Option<Vec<f32>>,
pub metadata: Option<HashMap<String, Value>>,
pub linked_node: Option<String>,
pub linked_row: Option<(String, u64)>,
}Expand description
A vector search result
Fields§
§id: u64Vector ID
collection: StringCollection name
distance: f32Distance to query vector
vector: Option<Vec<f32>>The vector data (if requested)
metadata: Option<HashMap<String, Value>>Metadata (if requested)
linked_node: Option<String>Linked node ID (if cross-referenced)
linked_row: Option<(String, u64)>Linked table row (table, row_id)
Implementations§
Source§impl VectorSearchResult
impl VectorSearchResult
Sourcepub fn new(
id: u64,
collection: impl Into<String>,
distance: f32,
) -> VectorSearchResult
pub fn new( id: u64, collection: impl Into<String>, distance: f32, ) -> VectorSearchResult
Create a new vector search result
Sourcepub fn with_vector(self, vector: Vec<f32>) -> VectorSearchResult
pub fn with_vector(self, vector: Vec<f32>) -> VectorSearchResult
Include vector data
Sourcepub fn with_metadata(
self,
metadata: HashMap<String, Value>,
) -> VectorSearchResult
pub fn with_metadata( self, metadata: HashMap<String, Value>, ) -> VectorSearchResult
Include metadata
Sourcepub fn with_linked_node(self, node_id: impl Into<String>) -> VectorSearchResult
pub fn with_linked_node(self, node_id: impl Into<String>) -> VectorSearchResult
Link to a graph node
Sourcepub fn with_linked_row(
self,
table: impl Into<String>,
row_id: u64,
) -> VectorSearchResult
pub fn with_linked_row( self, table: impl Into<String>, row_id: u64, ) -> VectorSearchResult
Link to a table row
Trait Implementations§
Source§impl Clone for VectorSearchResult
impl Clone for VectorSearchResult
Source§fn clone(&self) -> VectorSearchResult
fn clone(&self) -> VectorSearchResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 VectorSearchResult
impl Debug for VectorSearchResult
Source§impl Default for VectorSearchResult
impl Default for VectorSearchResult
Source§fn default() -> VectorSearchResult
fn default() -> VectorSearchResult
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Forget for VectorSearchResult
impl Freeze for VectorSearchResultwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<f32>: Freeze,
PhantomData<(String, Value)>: Freeze,
impl Move for VectorSearchResult
impl RefUnwindSafe for VectorSearchResult
impl Send for VectorSearchResult
impl Sync for VectorSearchResult
impl Unpin for VectorSearchResult
impl UnsafeUnpin for VectorSearchResultwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<f32>: UnsafeUnpin,
PhantomData<(String, Value)>: UnsafeUnpin,
impl UnwindSafe for VectorSearchResult
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request