Skip to main content

ProjectedQuery

Struct ProjectedQuery 

Source
pub struct ProjectedQuery { /* private fields */ }
Expand description

Typed projected-query request builder.

Implementations§

Source§

impl ProjectedQuery

Source

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.

Source

pub fn select(self, select: Vec<String>) -> Self

Sets selected field names (empty = all projected fields).

Source

pub fn predicates(self, predicates: Vec<ProjectedPredicate>) -> Self

Sets conjunctive predicates.

Source

pub fn order(self, order: Vec<ProjectedOrder>) -> Self

Sets sort keys (primary-key tie-break remains engine-owned).

Source

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.

Source

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.

Source

pub fn group_by(self, keys: Vec<String>) -> Self

Sets the group-by key field names (empty = whole-set aggregate).

Source

pub fn freshness(self, freshness: FreshnessPolicy) -> Self

Sets the freshness policy (Available / Bounded / Causal with token).

Source

pub const fn encoding(self, encoding: ProjectedResponseEncoding) -> Self

Selects row or packed Ready encoding.

Source

pub fn projection_name(&self) -> &str

Projection name.

Source

pub const fn response_encoding(&self) -> ProjectedResponseEncoding

Requested response encoding.

Source

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

Source§

fn clone(&self) -> ProjectedQuery

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProjectedQuery

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ProjectedQuery

Source§

impl PartialEq for ProjectedQuery

Source§

fn eq(&self, other: &ProjectedQuery) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ProjectedQuery

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more