pub struct Page<V: FhirVersion, R> { /* private fields */ }
Expand description
Wrapper around Bundle
s that have multiple pages of results, e.g. search results, resource
history, etc.
Implementations§
Source§impl<V: FhirVersion, R> Page<V, R>
impl<V: FhirVersion, R> Page<V, R>
Sourcepub fn next_page_url(&self) -> Option<&String>
pub fn next_page_url(&self) -> Option<&String>
Get the next page URL, if there is one.
Sourcepub async fn next_page(&self) -> Option<Result<Self, Error>>
pub async fn next_page(&self) -> Option<Result<Self, Error>>
Fetch the next page and return it.
Sourcepub fn total(&self) -> Option<u32>
pub fn total(&self) -> Option<u32>
Get the total
field, indicating the total number of results.
Sourcepub fn into_inner(self) -> V::Bundle
pub fn into_inner(self) -> V::Bundle
Consume the Page
and return the inner Bundle
.
Sourcepub fn take_entries(
&mut self,
) -> Vec<Option<<<V as FhirVersion>::Bundle as BundleExt>::Entry>>
pub fn take_entries( &mut self, ) -> Vec<Option<<<V as FhirVersion>::Bundle as BundleExt>::Entry>>
Consumes the raw inner entries, leaving the page empty. Returns the entries.
Sourcepub fn entries(&self) -> impl Iterator<Item = &V::Resource> + Send
pub fn entries(&self) -> impl Iterator<Item = &V::Resource> + Send
Get the entries of this page, ignoring entries whenever there is no resource
in the entry.
Sourcepub fn matches(&self) -> impl Iterator<Item = &R> + Send
pub fn matches(&self) -> impl Iterator<Item = &R> + Send
Get the matches of this page, ignoring entries whenever there is no resource
in the entry
or resources of the wrong type.
Sourcepub fn entries_owned(
&mut self,
) -> impl Stream<Item = Result<V::Resource, Error>> + Send + 'static
pub fn entries_owned( &mut self, ) -> impl Stream<Item = Result<V::Resource, Error>> + Send + 'static
Get the entries of this page, where the fullUrl
is automatically resolved whenever there
is no resource
in the entry. Delete entries are ignored as well (e.g. in history
requests), you can access the raw entries with Self::bundle or Self::take_entries if you
need these.
Consumes the entries, leaving the page empty.
Sourcepub fn matches_owned(
&mut self,
) -> impl Stream<Item = Result<R, Error>> + Send + 'static
pub fn matches_owned( &mut self, ) -> impl Stream<Item = Result<R, Error>> + Send + 'static
Get the matches of this page, where the fullUrl
is automatically resolved whenever there
is no resource
in the entry. Delete entries are ignored as well (e.g. in history
requests), you can access the raw entries with Self::bundle or Self::take_entries if you
need these. Ignores entries of the wrong resource type and entries without resource or full
URL.
Consumes the entries, leaving the page empty.
Sourcepub fn all_entries(
self,
) -> impl Stream<Item = Result<V::Resource, Error>> + Send + 'static
pub fn all_entries( self, ) -> impl Stream<Item = Result<V::Resource, Error>> + Send + 'static
Start automatic paging through all entries across pages.
Hint: you can activate pre-fetching by StreamExt::buffered.
Sourcepub fn all_matches(
self,
) -> impl Stream<Item = Result<R, Error>> + Send + 'static
pub fn all_matches( self, ) -> impl Stream<Item = Result<R, Error>> + Send + 'static
Start automatic paging through all matches across pages.
Hint: you can activate pre-fetching by StreamExt::buffered.