pub struct Query { /* private fields */ }Expand description
A query to ask with Kernable::query, built with methods that each return the changed
query: Query::new("shop", "GetCart").data(json!({ "id": "c1" })). Without data, the
query’s data is an empty object ({}).
Implementations§
Source§impl Query
impl Query
Sourcepub fn of<Q: QueryType>(query: Q) -> Query
pub fn of<Q: QueryType>(query: Q) -> Query
A query of a message type (see query); its type says the domain and the aggregate it
is about. Ask it with Kernable::ask for its typed answer.
§Panics
If query cannot be represented as JSON.
Sourcepub fn tenant(self, tenant: impl Into<String>) -> Query
pub fn tenant(self, tenant: impl Into<String>) -> Query
The tenant to ask in. Default: the connection’s (Options::tenant).
Sourcepub fn context(self, context: RequestContext) -> Query
pub fn context(self, context: RequestContext) -> Query
Replaces the client’s default context.
Sourcepub fn min_position(self, position: u64) -> Query
pub fn min_position(self, position: u64) -> Query
Answer only after the read model has processed this global position (e.g. of a committed submit).
Sourcepub fn timeout(self, timeout: Duration) -> Query
pub fn timeout(self, timeout: Duration) -> Query
How long to wait for the connection and the answer; default Options::timeout.
Sourcepub fn all_partitions(self) -> Query
pub fn all_partitions(self) -> Query
For a read model across tenants with partitions: answer only once the read model has processed every partition’s events up to the query, not only those of the tenant’s partition. Costs a wait-only query to each partition first.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Query
impl Freeze for Querywhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
impl Move for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Querywhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
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
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