Struct mastodon_async::requests::UpdatePushRequest
source · pub struct UpdatePushRequest { /* private fields */ }
Expand description
Data structure for the MastodonClient::add_push_subscription method Builder to pass to the Mastodon::update_push_data method
// Example
use mastodon_async::{Mastodon, Data, requests::UpdatePushRequest};
let data = Data::default();
let client = Mastodon::from(data);
let mut request = UpdatePushRequest::new("foobar");
request.follow(true)
.reblog(true);
tokio_test::block_on(async {
client.update_push_data(&request).await.unwrap();
});
Implementations§
source§impl UpdatePushRequest
impl UpdatePushRequest
sourcepub fn new(id: &str) -> UpdatePushRequest
pub fn new(id: &str) -> UpdatePushRequest
Construct a new UpdatePushRequest
// Example
let request = mastodon_async::requests::UpdatePushRequest::new("some-id");
sourcepub fn follow(&mut self, follow: bool) -> &mut Self
pub fn follow(&mut self, follow: bool) -> &mut Self
A flag that indicates if you want follow notifications pushed
// Example
let mut request = mastodon_async::requests::UpdatePushRequest::new("foobar");
request.follow(true);
sourcepub fn favourite(&mut self, favourite: bool) -> &mut Self
pub fn favourite(&mut self, favourite: bool) -> &mut Self
A flag that indicates if you want favourite notifications pushed
// Example
let mut request = mastodon_async::requests::UpdatePushRequest::new("foobar");
request.favourite(true);
Trait Implementations§
source§impl Clone for UpdatePushRequest
impl Clone for UpdatePushRequest
source§fn clone(&self) -> UpdatePushRequest
fn clone(&self) -> UpdatePushRequest
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 Debug for UpdatePushRequest
impl Debug for UpdatePushRequest
source§impl Default for UpdatePushRequest
impl Default for UpdatePushRequest
source§fn default() -> UpdatePushRequest
fn default() -> UpdatePushRequest
Returns the “default value” for a type. Read more
source§impl PartialEq for UpdatePushRequest
impl PartialEq for UpdatePushRequest
source§fn eq(&self, other: &UpdatePushRequest) -> bool
fn eq(&self, other: &UpdatePushRequest) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for UpdatePushRequest
impl Serialize for UpdatePushRequest
impl Eq for UpdatePushRequest
impl StructuralPartialEq for UpdatePushRequest
Auto Trait Implementations§
impl RefUnwindSafe for UpdatePushRequest
impl Send for UpdatePushRequest
impl Sync for UpdatePushRequest
impl Unpin for UpdatePushRequest
impl UnwindSafe for UpdatePushRequest
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.