pub struct Query { /* private fields */ }Expand description
Fluent builder for query configurations.
Use Query::cypher() or Query::gql() to get started.
§Example
use drasi_lib::Query;
let query_config = Query::cypher("my-query")
.query("MATCH (n:Person) RETURN n.name, n.age")
.from_source("my-source")
.auto_start(true)
.build();Implementations§
Source§impl Query
impl Query
Sourcepub fn from_source(self, source_id: impl Into<String>) -> Self
pub fn from_source(self, source_id: impl Into<String>) -> Self
Subscribe to a source.
Sourcepub fn from_source_with_pipeline(
self,
source_id: impl Into<String>,
pipeline: Vec<String>,
) -> Self
pub fn from_source_with_pipeline( self, source_id: impl Into<String>, pipeline: Vec<String>, ) -> Self
Subscribe to a source with a middleware pipeline.
The pipeline is a list of middleware names (strings) that will be applied to data from this source before it reaches the query.
Sourcepub fn with_middleware(self, middleware: SourceMiddlewareConfig) -> Self
pub fn with_middleware(self, middleware: SourceMiddlewareConfig) -> Self
Add middleware to the query.
Sourcepub fn auto_start(self, auto_start: bool) -> Self
pub fn auto_start(self, auto_start: bool) -> Self
Set whether the query should auto-start.
Sourcepub fn with_joins(self, joins: Vec<QueryJoinConfig>) -> Self
pub fn with_joins(self, joins: Vec<QueryJoinConfig>) -> Self
Set the join configuration.
Sourcepub fn enable_bootstrap(self, enable: bool) -> Self
pub fn enable_bootstrap(self, enable: bool) -> Self
Enable or disable bootstrap.
Sourcepub fn with_bootstrap_buffer_size(self, size: usize) -> Self
pub fn with_bootstrap_buffer_size(self, size: usize) -> Self
Set the bootstrap buffer size.
Sourcepub fn with_priority_queue_capacity(self, capacity: usize) -> Self
pub fn with_priority_queue_capacity(self, capacity: usize) -> Self
Set the priority queue capacity.
Sourcepub fn with_dispatch_buffer_capacity(self, capacity: usize) -> Self
pub fn with_dispatch_buffer_capacity(self, capacity: usize) -> Self
Set the dispatch buffer capacity.
Sourcepub fn with_dispatch_mode(self, mode: DispatchMode) -> Self
pub fn with_dispatch_mode(self, mode: DispatchMode) -> Self
Set the dispatch mode.
Sourcepub fn with_storage_backend(self, backend: StorageBackendRef) -> Self
pub fn with_storage_backend(self, backend: StorageBackendRef) -> Self
Set the storage backend reference.
Sourcepub fn build(self) -> QueryConfig
pub fn build(self) -> QueryConfig
Build the query configuration.
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnwindSafe for Query
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