Skip to main content

Page

Struct Page 

Source
#[non_exhaustive]
pub struct Page<T> { pub count: u64, pub next: Option<String>, pub previous: Option<String>, pub count_type: Option<String>, pub meta: Option<Value>, pub page_metadata: Option<Value>, pub cursor: Option<String>, pub results: Vec<T>, }
Expand description

A single page of results from a list endpoint.

next/previous are the server-supplied URLs to the adjacent pages; cursor is the keyset cursor extracted from next for convenience (empty on offset-paginated endpoints).

The struct is #[non_exhaustive]: the SDK builds pages, callers read them.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§count: u64

Total number of items across all pages, when the server reports it. For some endpoints this matches results.len().

§next: Option<String>

URL of the next page, or None when on the last page.

§previous: Option<String>

URL of the previous page, or None when on the first page.

§count_type: Option<String>

"exact" or "approximate", from the response’s X-Results-CountType header; None when the endpoint does not send it.

Past 1,000 matches the contract, IDV, opportunity and notice lists may report a query-planner estimate as count, which can be well off; this says which one you got. It is read from this page’s own response, so concurrent calls on one client never see each other’s value the way Client::last_response_headers can.

§meta: Option<Value>

The response’s meta object, passed through as the API sends it: agency-filter diagnostics (resolved_filters, agency_warnings, unresolved_agency_tokens, resolved_agencies), upgrade_hints and the like.

Each entry of meta["resolved_filters"][<filter name>] that resolved says how its token matched in matched_by (Tango API 5.9.0+): key (an organization UUID), code (a 3-digit CGAC or 4-digit FPDS code), name (the organization’s name, including a department’s everyday name, a spelling variant or a rename), alias (an abbreviation or the organization’s own alias) or fuzzy (a looser text match, worth checking against the resolved name). An entry that did not resolve has no matched_by.

§page_metadata: Option<Value>

Opaque page metadata for keyset endpoints.

§cursor: Option<String>

Cursor extracted from next on cursor-paginated endpoints. Pass it back via the cursor option to fetch the next page. Empty when the endpoint is offset-paginated or no cursor is set.

§results: Vec<T>

The actual data for this page.

Trait Implementations§

Source§

impl<T: Clone> Clone for Page<T>

Source§

fn clone(&self) -> Self

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<T: Debug> Debug for Page<T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Page<T>
where Vec<T>: Freeze,

§

impl<T> RefUnwindSafe for Page<T>
where Vec<T>: RefUnwindSafe,

§

impl<T> Send for Page<T>
where Vec<T>: Send,

§

impl<T> Sync for Page<T>
where Vec<T>: Sync,

§

impl<T> Unpin for Page<T>
where Vec<T>: Unpin,

§

impl<T> UnsafeUnpin for Page<T>
where Vec<T>: UnsafeUnpin,

§

impl<T> UnwindSafe for Page<T>
where Vec<T>: UnwindSafe,

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
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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.

Source§

impl<T> MaybeSendSync for T

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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