pub struct QueryParams {
pub position: Option<i64>,
pub anchor: Option<Id>,
pub anchor_offset: Option<i64>,
pub limit: Option<u64>,
pub calculate_total: Option<bool>,
pub extra: Map<String, Value>,
}Expand description
The RFC 8620 §5.5 /query arguments shared by every Foo/query
method: which window of the result list to return and whether to
compute the total.
accountId, filter and sort are passed to each *_query method
separately because their types differ per object type; the
type-specific arguments some methods define (for example
collapseThreads on Email/query, RFC 8621 §4.4) are passed the
same way. Every field defaults to None, which omits the argument so
the server applies the RFC 8620 §5.5 default:
use jmap_base_client::QueryParams;
let page = QueryParams {
limit: Some(50),
calculate_total: Some(true),
..QueryParams::default()
};Fields§
§position: Option<i64>position (RFC 8620 §5.5, Int, default 0): zero-based index of
the first id to return. A negative value is an offset from the end
of the result list. Ignored by the server when Self::anchor is
set.
anchor: Option<Id>anchor (RFC 8620 §5.5, Id|null): an id in the result list; the
returned window starts at its index plus Self::anchor_offset.
The server returns anchorNotFound if the id is not in the
results.
anchor_offset: Option<i64>anchorOffset (RFC 8620 §5.5, Int, default 0): index of the
first result relative to Self::anchor; may be negative.
limit: Option<u64>limit (RFC 8620 §5.5, UnsignedInt|null): maximum number of ids
to return. The server may clamp it to its own maximum and report
the clamped value in the response.
calculate_total: Option<bool>calculateTotal (RFC 8620 §5.5, Boolean, default false): ask
the server to return total in the response.
extra: Map<String, Value>Vendor or extension arguments not covered by the typed fields.
Typed fields and the method’s own accountId / filter / sort
and type-specific arguments win on a key collision; place vendor
extensions under vendor-prefixed keys (e.g. "acmeCorpFoo").
Implementations§
Source§impl QueryParams
impl QueryParams
Sourcepub fn to_arguments(&self, account_id: &str) -> Value
pub fn to_arguments(&self, account_id: &str) -> Value
Build the /query arguments object: Self::extra, then
accountId and every typed field that is Some.
Callers add filter, sort and type-specific arguments to the
returned object.