[][src]Struct elefren::AddPushRequest

pub struct AddPushRequest { /* fields omitted */ }

Builder to pass to the Mastodon::add_push_subscription method

Example

use elefren::requests::{AddPushRequest, Keys};

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)?;

Methods

impl AddPushRequest[src]

pub fn new(endpoint: &str, keys: &Keys) -> AddPushRequest[src]

Construct a new AddPushRequest

Example

use elefren::requests::{AddPushRequest, Keys};
let keys = Keys::new("abcdef===", "foobar==");
let push_endpoint = "https://example.com/push/endpoint";
let request = AddPushRequest::new(push_endpoint, &keys);

pub fn follow(&mut self) -> &mut Self[src]

A flag that indicates if you want follow notifications pushed

Example

use elefren::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();

pub fn favourite(&mut self) -> &mut Self[src]

A flag that indicates if you want favourite notifications pushed

Example

use elefren::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();

pub fn reblog(&mut self) -> &mut Self[src]

A flag that indicates if you want reblog notifications pushed

Example

use elefren::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();

pub fn mention(&mut self) -> &mut Self[src]

A flag that indicates if you want mention notifications pushed

Example

use elefren::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

impl PartialEq<AddPushRequest> for AddPushRequest[src]

impl Clone for AddPushRequest[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for AddPushRequest[src]

impl Debug for AddPushRequest[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Err = <U as TryFrom<T>>::Err