pub struct QueryRouter { /* private fields */ }Expand description
Query router - routes queries to appropriate nodes
Implementations§
Source§impl QueryRouter
impl QueryRouter
Sourcepub fn new(config: RoutingConfig) -> Self
pub fn new(config: RoutingConfig) -> Self
Create a new query router
Sourcepub async fn route(&self, query: &str) -> RoutingDecision
pub async fn route(&self, query: &str) -> RoutingDecision
Route a query
Sourcepub async fn route_with_criteria(
&self,
criteria: &NodeCriteria,
) -> Result<String>
pub async fn route_with_criteria( &self, criteria: &NodeCriteria, ) -> Result<String>
Route with explicit hints (for use by other modules)
Sourcepub fn is_write_query(&self, query: &str) -> bool
pub fn is_write_query(&self, query: &str) -> bool
Check if query is a write operation
Sourcepub fn strip_hints(&self, query: &str) -> String
pub fn strip_hints(&self, query: &str) -> String
Strip hints from query for backend execution
Sourcepub fn parse_hints(&self, query: &str) -> ParsedHints
pub fn parse_hints(&self, query: &str) -> ParsedHints
Parse hints from query (for external use)
Sourcepub async fn remove_node(&self, name: &str)
pub async fn remove_node(&self, name: &str)
Remove a node by name
Sourcepub async fn update_node<F>(&self, name: &str, f: F)
pub async fn update_node<F>(&self, name: &str, f: F)
Update node state
Sourcepub fn metrics(&self) -> &RoutingMetrics
pub fn metrics(&self) -> &RoutingMetrics
Get metrics
Sourcepub fn config(&self) -> &RoutingConfig
pub fn config(&self) -> &RoutingConfig
Get configuration
Auto Trait Implementations§
impl !Freeze for QueryRouter
impl !RefUnwindSafe for QueryRouter
impl Send for QueryRouter
impl Sync for QueryRouter
impl Unpin for QueryRouter
impl UnsafeUnpin for QueryRouter
impl !UnwindSafe for QueryRouter
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> 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 more