pub struct QueryHints {
pub target_shards: Option<Vec<String>>,
pub scatter_gather: bool,
pub shard_key_value: Option<Value>,
pub query_type: Option<String>,
}Expand description
Hints for query routing when a specific shard key isn’t available.
When executing queries that don’t have a clear shard key (e.g., range queries,
aggregations), these hints help the ShardChooser decide which shards to query.
Fields§
§target_shards: Option<Vec<String>>Specific shard names to target (if known).
scatter_gather: boolWhether to query all shards (scatter-gather).
shard_key_value: Option<Value>Optional shard key value extracted from query predicates.
query_type: Option<String>Query type hint (e.g., “select”, “aggregate”, “count”).
Implementations§
Source§impl QueryHints
impl QueryHints
Sourcepub fn scatter_gather(self) -> Self
pub fn scatter_gather(self) -> Self
Enable scatter-gather mode (query all shards).
Sourcepub fn with_shard_key(self, value: Value) -> Self
pub fn with_shard_key(self, value: Value) -> Self
Provide a shard key value for routing.
Sourcepub fn query_type(self, query_type: impl Into<String>) -> Self
pub fn query_type(self, query_type: impl Into<String>) -> Self
Set the query type hint.
Trait Implementations§
Source§impl Clone for QueryHints
impl Clone for QueryHints
Source§fn clone(&self) -> QueryHints
fn clone(&self) -> QueryHints
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 QueryHints
impl Debug for QueryHints
Source§impl Default for QueryHints
impl Default for QueryHints
Source§fn default() -> QueryHints
fn default() -> QueryHints
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for QueryHints
impl RefUnwindSafe for QueryHints
impl Send for QueryHints
impl Sync for QueryHints
impl Unpin for QueryHints
impl UnwindSafe for QueryHints
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> 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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).