pub struct PostsRequestBuilder<'a> { /* private fields */ }Expand description
Request builder for the Posts endpoint.
See the posts function for proper usage.
Implementations§
Source§impl<'a> PostsRequestBuilder<'a>
impl<'a> PostsRequestBuilder<'a>
Sourcepub fn limit(self, limit: usize) -> Self
pub fn limit(self, limit: usize) -> Self
Amount of posts to recieve.
When unspecified, default limit is 100, as set by the server.
Sourcepub fn tag<S: Into<Cow<'a, str>>>(self, tag: S) -> Self
pub fn tag<S: Into<Cow<'a, str>>>(self, tag: S) -> Self
Add a single tag to the list of tags to search for.
To clear already set tags, see clear_tags.
§Example
posts()
.tag("hello")
.tag("world".to_string())
.send(&client)
.await?;
Tags to search for. Any tag combination that works on the website will work here, including meta-tags.
Can be chained; previously added tags are not overridden.
To clear already set tags, see clear_tags.
§Example
posts()
.tags(&["hello", "world"])
.tags(&vec!["how", "are", "you?"])
.send(&client)
.await?;
Append string directly to tag search
!! These are not checked when being submitted !! You can easily mess up the query construction using these.
Probably only useful for setting meta-tags.
Sourcepub fn random(self, random: bool) -> Self
pub fn random(self, random: bool) -> Self
Randomize the order of posts.
This is a server-side meta-tag feature, and is only provided for completeness’ sake.
§Example
posts()
.tags(&["hatsune_miku"])
.random(true)
.send(&client)
.await?;
pub async fn send(self, client: &Client) -> Result<PostQuery, Error>
Trait Implementations§
Source§impl<'a> Clone for PostsRequestBuilder<'a>
impl<'a> Clone for PostsRequestBuilder<'a>
Source§fn clone(&self) -> PostsRequestBuilder<'a>
fn clone(&self) -> PostsRequestBuilder<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more