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