pub struct QueryClient { /* private fields */ }Expand description
Default event query client using tonic gRPC.
Implementations§
Source§impl QueryClient
impl QueryClient
Sourcepub async fn connect(endpoint: &str) -> Result<Self>
pub async fn connect(endpoint: &str) -> Result<Self>
Connect to an event query service at the given endpoint.
Supports both TCP (host:port) and Unix Domain Sockets (file paths).
Sourcepub async fn from_env(env_var: &str, default: &str) -> Result<Self>
pub async fn from_env(env_var: &str, default: &str) -> Result<Self>
Connect using an endpoint from environment variable with fallback.
Sourcepub fn from_channel(channel: Channel) -> Self
pub fn from_channel(channel: Channel) -> Self
Create a client from an existing channel.
Sourcepub async fn get_events(&self, query: Query) -> Result<EventBook>
pub async fn get_events(&self, query: Query) -> Result<EventBook>
Query events for an aggregate.
Trait Implementations§
Source§impl Clone for QueryClient
impl Clone for QueryClient
Source§fn clone(&self) -> QueryClient
fn clone(&self) -> QueryClient
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 QueryClient for QueryClient
impl QueryClient for QueryClient
Auto Trait Implementations§
impl !Freeze for QueryClient
impl !RefUnwindSafe for QueryClient
impl Send for QueryClient
impl Sync for QueryClient
impl Unpin for QueryClient
impl UnsafeUnpin for QueryClient
impl !UnwindSafe for QueryClient
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: 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>
Wrap the input message
T in a tonic::RequestSource§impl<T> QueryBuilderExt for Twhere
T: QueryClient,
impl<T> QueryBuilderExt for Twhere
T: QueryClient,
Source§fn query(&self, domain: impl Into<String>, root: Uuid) -> QueryBuilder<'_, Self>
fn query(&self, domain: impl Into<String>, root: Uuid) -> QueryBuilder<'_, Self>
Start building a query for the given domain and root.
Source§fn query_domain(&self, domain: impl Into<String>) -> QueryBuilder<'_, Self>
fn query_domain(&self, domain: impl Into<String>) -> QueryBuilder<'_, Self>
Start building a query by domain only (use with by_correlation_id).