pub struct ProjectedQuery { /* private fields */ }Expand description
Typed projected-query request builder.
Implementations§
Source§impl ProjectedQuery
impl ProjectedQuery
Sourcepub fn new(
contract: ApplicationContract,
projection_name: impl Into<String>,
org_scope: ApplicationValue,
) -> Result<Self, ApplicationClientError>
pub fn new( contract: ApplicationContract, projection_name: impl Into<String>, org_scope: ApplicationValue, ) -> Result<Self, ApplicationClientError>
Builds a projected query with required org scope and available freshness.
Sourcepub fn select(self, select: Vec<String>) -> Self
pub fn select(self, select: Vec<String>) -> Self
Sets selected field names (empty = all projected fields).
Sourcepub fn predicates(self, predicates: Vec<ProjectedPredicate>) -> Self
pub fn predicates(self, predicates: Vec<ProjectedPredicate>) -> Self
Sets conjunctive predicates.
Sourcepub fn order(self, order: Vec<ProjectedOrder>) -> Self
pub fn order(self, order: Vec<ProjectedOrder>) -> Self
Sets sort keys (primary-key tie-break remains engine-owned).
Sourcepub fn limit(self, limit: Option<u32>) -> Self
pub fn limit(self, limit: Option<u32>) -> Self
Sets the declared result bound: the post-sort row limit.
For a request with Self::group_by keys this is the maximum number of
groups the query may return — grouped results are measured in groups
rather than rows. Exceeding it is a typed rejection returning nothing,
not a truncated set of groups.
It has no effect on an aggregate without group keys: that result is one value per requested function however many rows were folded.
Sourcepub fn aggregate(self, aggregate: ProjectedAggregate) -> Self
pub fn aggregate(self, aggregate: ProjectedAggregate) -> Self
Adds one aggregate function; repeat for several.
A query with at least one aggregate answers with
ProjectedQueryOutcome::ReadyAggregates instead of rows, and the
requested ProjectedResponseEncoding no longer applies.
Several functions require Self::group_by keys: the server computes
exactly one whole-set function per query.
Sourcepub fn group_by(self, keys: Vec<String>) -> Self
pub fn group_by(self, keys: Vec<String>) -> Self
Sets the group-by key field names (empty = whole-set aggregate).
Sourcepub fn freshness(self, freshness: FreshnessPolicy) -> Self
pub fn freshness(self, freshness: FreshnessPolicy) -> Self
Sets the freshness policy (Available / Bounded / Causal with token).
Sourcepub const fn encoding(self, encoding: ProjectedResponseEncoding) -> Self
pub const fn encoding(self, encoding: ProjectedResponseEncoding) -> Self
Selects row or packed Ready encoding.
Sourcepub fn projection_name(&self) -> &str
pub fn projection_name(&self) -> &str
Projection name.
Sourcepub const fn response_encoding(&self) -> ProjectedResponseEncoding
pub const fn response_encoding(&self) -> ProjectedResponseEncoding
Requested response encoding.
Sourcepub fn into_wire_request(
self,
) -> Result<ExecuteProjectedQueryRequest, ApplicationClientError>
pub fn into_wire_request( self, ) -> Result<ExecuteProjectedQueryRequest, ApplicationClientError>
Builds the public wire request (for tests and advanced callers).
Trait Implementations§
Source§impl Clone for ProjectedQuery
impl Clone for ProjectedQuery
Source§fn clone(&self) -> ProjectedQuery
fn clone(&self) -> ProjectedQuery
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProjectedQuery
impl Debug for ProjectedQuery
impl Eq for ProjectedQuery
Source§impl PartialEq for ProjectedQuery
impl PartialEq for ProjectedQuery
Source§fn eq(&self, other: &ProjectedQuery) -> bool
fn eq(&self, other: &ProjectedQuery) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ProjectedQuery
Auto Trait Implementations§
impl !Freeze for ProjectedQuery
impl RefUnwindSafe for ProjectedQuery
impl Send for ProjectedQuery
impl Sync for ProjectedQuery
impl Unpin for ProjectedQuery
impl UnsafeUnpin for ProjectedQuery
impl UnwindSafe for ProjectedQuery
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].