Struct mastodon_async::requests::StatusesRequest
source · pub struct StatusesRequest<'a> { /* private fields */ }
Expand description
Data structure for the MastodonClient::statuses method Builder for making a client.statuses() call
// Example
use mastodon_async::requests::StatusesRequest;
let mut request = StatusesRequest::new();
request.only_media().pinned().since_id("foo");
assert_eq!(&request.to_query_string().expect("Couldn't serialize qs")[..], "?only_media=1&pinned=1&since_id=foo");
Implementations§
source§impl<'a> StatusesRequest<'a>
impl<'a> StatusesRequest<'a>
sourcepub fn only_media(&mut self) -> &mut Self
pub fn only_media(&mut self) -> &mut Self
Set the ?only_media=1
flag for the .statuses() request
// Example
use mastodon_async::requests::StatusesRequest;
let mut request = StatusesRequest::new();
assert_eq!(&request.only_media().to_query_string().expect("Couldn't serialize qs"), "?only_media=1");
sourcepub fn exclude_replies(&mut self) -> &mut Self
pub fn exclude_replies(&mut self) -> &mut Self
Set the ?exclude_replies=1
flag for the .statuses() request
// Example
use mastodon_async::requests::StatusesRequest;
let mut request = StatusesRequest::new();
assert_eq!(
&request
.exclude_replies()
.to_query_string()
.expect("Couldn't serialize qs"),
"?exclude_replies=1"
);
sourcepub fn pinned(&mut self) -> &mut Self
pub fn pinned(&mut self) -> &mut Self
Set the ?pinned=1
flag for the .statuses() request
// Example
use mastodon_async::requests::StatusesRequest;
let mut request = StatusesRequest::new();
assert_eq!(
&request
.pinned()
.to_query_string()
.expect("Couldn't serialize qs"),
"?pinned=1"
);
sourcepub fn max_id<S: Into<Cow<'a, str>>>(&mut self, max_id: S) -> &mut Self
pub fn max_id<S: Into<Cow<'a, str>>>(&mut self, max_id: S) -> &mut Self
Set the ?max_id=:max_id
flag for the .statuses() request
// Example
use mastodon_async::requests::StatusesRequest;
let mut request = StatusesRequest::new();
assert_eq!(
&request
.max_id("foo")
.to_query_string()
.expect("Couldn't serialize qs"),
"?max_id=foo"
);
sourcepub fn since_id<S: Into<Cow<'a, str>>>(&mut self, since_id: S) -> &mut Self
pub fn since_id<S: Into<Cow<'a, str>>>(&mut self, since_id: S) -> &mut Self
Set the ?since_id=:since_id
flag for the .statuses() request
// Example
use mastodon_async::requests::StatusesRequest;
let mut request = StatusesRequest::new();
assert_eq!(
&request
.since_id("foo")
.to_query_string()
.expect("Couldn't serialize qs"),
"?since_id=foo"
);
sourcepub fn limit(&mut self, limit: usize) -> &mut Self
pub fn limit(&mut self, limit: usize) -> &mut Self
Set the ?limit=:limit
flag for the .statuses() request
// Example
use mastodon_async::requests::StatusesRequest;
let mut request = StatusesRequest::new();
assert_eq!(
&request
.limit(10)
.to_query_string()
.expect("Couldn't serialize qs"),
"?limit=10"
);
sourcepub fn min_id<S: Into<Cow<'a, str>>>(&mut self, min_id: S) -> &mut Self
pub fn min_id<S: Into<Cow<'a, str>>>(&mut self, min_id: S) -> &mut Self
Set the ?min_id=:min_id
flag for the .statuses() request
// Example
use mastodon_async::requests::StatusesRequest;
let mut request = StatusesRequest::new();
assert_eq!(
&request
.min_id("foobar")
.to_query_string()
.expect("Couldn't serialize qs"),
"?min_id=foobar"
);
sourcepub fn to_query_string(&self) -> Result<String, Error>
pub fn to_query_string(&self) -> Result<String, Error>
Serialize into a query string
Trait Implementations§
source§impl<'a> Clone for StatusesRequest<'a>
impl<'a> Clone for StatusesRequest<'a>
source§fn clone(&self) -> StatusesRequest<'a>
fn clone(&self) -> StatusesRequest<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for StatusesRequest<'a>
impl<'a> Debug for StatusesRequest<'a>
source§impl<'a> Default for StatusesRequest<'a>
impl<'a> Default for StatusesRequest<'a>
source§fn default() -> StatusesRequest<'a>
fn default() -> StatusesRequest<'a>
Returns the “default value” for a type. Read more
source§impl<'a> From<&'a mut StatusesRequest<'a>> for Option<StatusesRequest<'a>>
impl<'a> From<&'a mut StatusesRequest<'a>> for Option<StatusesRequest<'a>>
source§fn from(sr: &'a mut StatusesRequest<'a>) -> Self
fn from(sr: &'a mut StatusesRequest<'a>) -> Self
Converts to this type from the input type.
source§impl<'a> PartialEq for StatusesRequest<'a>
impl<'a> PartialEq for StatusesRequest<'a>
source§fn eq(&self, other: &StatusesRequest<'a>) -> bool
fn eq(&self, other: &StatusesRequest<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a> Serialize for StatusesRequest<'a>
impl<'a> Serialize for StatusesRequest<'a>
impl<'a> Eq for StatusesRequest<'a>
impl<'a> StructuralPartialEq for StatusesRequest<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for StatusesRequest<'a>
impl<'a> Send for StatusesRequest<'a>
impl<'a> Sync for StatusesRequest<'a>
impl<'a> Unpin for StatusesRequest<'a>
impl<'a> UnwindSafe for StatusesRequest<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.