pub struct FirestoreFindNearestOptions {
pub field_name: String,
pub query_vector: FirestoreVector,
pub distance_measure: FirestoreFindNearestDistanceMeasure,
pub neighbors_limit: u32,
pub distance_result_field: Option<String>,
pub distance_threshold: Option<f64>,
}Expand description
Re-exports all public items from the db module.
The db module contains the core FirestoreDb client and
functionalities for interacting with the Firestore database, such as CRUD operations,
queries, and transactions.
Options for performing a vector similarity search (find nearest neighbors).
This is used to find documents whose vector field is closest to a given query vector.
Fields§
§field_name: StringThe path to the vector field in your documents to search against.
query_vector: FirestoreVectorThe query vector to find nearest neighbors for.
distance_measure: FirestoreFindNearestDistanceMeasureThe distance measure to use for comparing vectors.
neighbors_limit: u32The maximum number of nearest neighbors to return.
distance_result_field: Option<String>An optional field name to store the calculated distance in the query results. If provided, each returned document will include this field with the distance value.
distance_threshold: Option<f64>An optional threshold for the distance. Only neighbors within this distance will be returned.
Implementations§
Source§impl FirestoreFindNearestOptions
impl FirestoreFindNearestOptions
pub fn new( field_name: String, query_vector: FirestoreVector, distance_measure: FirestoreFindNearestDistanceMeasure, neighbors_limit: u32, ) -> Self
pub fn field_name(&mut self, value: String) -> &mut Self
pub fn with_field_name(self, value: String) -> Self
pub fn query_vector(&mut self, value: FirestoreVector) -> &mut Self
pub fn with_query_vector(self, value: FirestoreVector) -> Self
pub fn distance_measure( &mut self, value: FirestoreFindNearestDistanceMeasure, ) -> &mut Self
pub fn with_distance_measure( self, value: FirestoreFindNearestDistanceMeasure, ) -> Self
pub fn neighbors_limit(&mut self, value: u32) -> &mut Self
pub fn with_neighbors_limit(self, value: u32) -> Self
pub fn distance_result_field(&mut self, value: String) -> &mut Self
pub fn reset_distance_result_field(&mut self) -> &mut Self
pub fn mopt_distance_result_field(&mut self, value: Option<String>) -> &mut Self
pub fn with_distance_result_field(self, value: String) -> Self
pub fn without_distance_result_field(self) -> Self
pub fn opt_distance_result_field(self, value: Option<String>) -> Self
pub fn distance_threshold(&mut self, value: f64) -> &mut Self
pub fn reset_distance_threshold(&mut self) -> &mut Self
pub fn mopt_distance_threshold(&mut self, value: Option<f64>) -> &mut Self
pub fn with_distance_threshold(self, value: f64) -> Self
pub fn without_distance_threshold(self) -> Self
pub fn opt_distance_threshold(self, value: Option<f64>) -> Self
Trait Implementations§
Source§impl Clone for FirestoreFindNearestOptions
impl Clone for FirestoreFindNearestOptions
Source§fn clone(&self) -> FirestoreFindNearestOptions
fn clone(&self) -> FirestoreFindNearestOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FirestoreFindNearestOptions
impl Debug for FirestoreFindNearestOptions
Source§impl From<FirestoreFindNearestOptionsInit> for FirestoreFindNearestOptions
impl From<FirestoreFindNearestOptionsInit> for FirestoreFindNearestOptions
Source§fn from(value: FirestoreFindNearestOptionsInit) -> Self
fn from(value: FirestoreFindNearestOptionsInit) -> Self
impl StructuralPartialEq for FirestoreFindNearestOptions
Source§impl TryFrom<FirestoreFindNearestOptions> for FindNearest
impl TryFrom<FirestoreFindNearestOptions> for FindNearest
Source§type Error = FirestoreError
type Error = FirestoreError
Auto Trait Implementations§
impl Freeze for FirestoreFindNearestOptions
impl RefUnwindSafe for FirestoreFindNearestOptions
impl Send for FirestoreFindNearestOptions
impl Sync for FirestoreFindNearestOptions
impl Unpin for FirestoreFindNearestOptions
impl UnsafeUnpin for FirestoreFindNearestOptions
impl UnwindSafe for FirestoreFindNearestOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request