pub struct TagsRequest<'a> { /* private fields */ }Expand description
A builder for the tag-listing endpoints — the whole-vocabulary pair
Client::tags (fred/tags) / Client::related_tags
(fred/related_tags), and the scoped variants that list the tags of one
category, release, or series search: Client::category_tags,
Client::category_related_tags, Client::release_tags,
Client::release_related_tags, Client::series_search_tags, and
Client::series_search_related_tags.
All share optional tag-filter text, sort, and paging and return
TagsResults. Each *_related_tags variant additionally carries a seed
tag_names set (the tags to find co-occurring tags for); each scoped
variant carries its scope facet (category_id / release_id /
series_search_text). Finish with send.
let results = client.tags().search_text("gdp").limit(10).send().await?;
for tag in &results.tags {
println!("{} ({} series)", tag.name, tag.series_count);
}Implementations§
Source§impl<'a> TagsRequest<'a>
impl<'a> TagsRequest<'a>
Sourcepub fn search_text(self, text: impl Into<String>) -> Self
pub fn search_text(self, text: impl Into<String>) -> Self
Restrict to tags matching these words (search_text, or
tag_search_text for the series/search/* endpoints).
Sourcepub fn sort_order(self, order: SortOrder) -> Self
pub fn sort_order(self, order: SortOrder) -> Self
Sort order of the results (sort_order); tags are ordered by series
count by default.
Sourcepub fn offset(self, offset: u32) -> Self
pub fn offset(self, offset: u32) -> Self
Number of results to skip from the start (offset), for paging.
Sourcepub async fn send(self) -> Result<TagsResults>
pub async fn send(self) -> Result<TagsResults>
Run the request and return a page of tags with pagination metadata.
§Errors
Returns an error if the request fails to send, FRED returns a non-success status, or the response body cannot be deserialized.
Trait Implementations§
Source§impl<'a> Clone for TagsRequest<'a>
impl<'a> Clone for TagsRequest<'a>
Source§fn clone(&self) -> TagsRequest<'a>
fn clone(&self) -> TagsRequest<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for TagsRequest<'a>
impl<'a> Debug for TagsRequest<'a>
Source§impl Paginate for TagsRequest<'_>
impl Paginate for TagsRequest<'_>
Source§const MAX_PAGE: u32 = 1000
const MAX_PAGE: u32 = 1000
limit it
honors. 1000 for most lists; 10000 for release dates and vintage dates.Source§type Page = TagsResults
type Page = TagsResults
Source§fn requested_limit(&self) -> Option<u32>
fn requested_limit(&self) -> Option<u32>
limit, if set. send_all
treats it as a ceiling on the total number of items returned.Source§fn requested_offset(&self) -> Option<u32>
fn requested_offset(&self) -> Option<u32>
offset, if set — the point
send_all starts paging from.Source§fn with_paging(self, limit: u32, offset: u32) -> Self
fn with_paging(self, limit: u32, offset: u32) -> Self
limit and offset set.Source§fn send_page(self) -> impl Future<Output = Result<Self::Page>> + Send
fn send_page(self) -> impl Future<Output = Result<Self::Page>> + Send
send.