[][src]Struct mammut::Mastodon

pub struct Mastodon {
    pub data: Data,
    // some fields omitted
}

Your mastodon application client, handles all requests to and from Mastodon.

Fields

data: Data

Raw data about your mastodon instance.

Methods

impl Mastodon[src]

pub fn from_data(data: Data) -> Self[src]

Creates a mastodon instance from the data struct.

pub fn favourites(&self) -> Result<Page<Status>>[src]

Equivalent to /api/v1/favourites

Errors

If access_token is not set.

pub fn blocks(&self) -> Result<Page<Account>>[src]

Equivalent to /api/v1/blocks

Errors

If access_token is not set.

pub fn domain_blocks(&self) -> Result<Page<String>>[src]

Equivalent to /api/v1/domain_blocks

Errors

If access_token is not set.

pub fn follow_requests(&self) -> Result<Page<Account>>[src]

Equivalent to /api/v1/follow_requests

Errors

If access_token is not set.

pub fn get_home_timeline(&self) -> Result<Page<Status>>[src]

Equivalent to /api/v1/timelines/home

Errors

If access_token is not set.

pub fn get_emojis(&self) -> Result<Page<Emoji>>[src]

Equivalent to /api/v1/custom_emojis

Errors

If access_token is not set.

pub fn mutes(&self) -> Result<Page<Account>>[src]

Equivalent to /api/v1/mutes

Errors

If access_token is not set.

pub fn notifications(&self) -> Result<Page<Notification>>[src]

Equivalent to /api/v1/notifications

Errors

If access_token is not set.

pub fn reports(&self) -> Result<Page<Report>>[src]

Equivalent to /api/v1/reports

Errors

If access_token is not set.

pub fn followers(&self, id: &str) -> Result<Page<Account>>[src]

Equivalent to /api/v1/accounts/{}/followers

Errors

If access_token is not set.

pub fn following(&self, id: &str) -> Result<Page<Account>>[src]

Equivalent to /api/v1/accounts/{}/following

Errors

If access_token is not set.

pub fn reblogged_by(&self, id: &str) -> Result<Page<Account>>[src]

Equivalent to /api/v1/statuses/{}/reblogged_by

Errors

If access_token is not set.

pub fn favourited_by(&self, id: &str) -> Result<Page<Account>>[src]

Equivalent to /api/v1/statuses/{}/favourited_by

Errors

If access_token is not set.

pub fn unblock_domain(&self, domain: String) -> Result<Empty>[src]

Equivalent to /api/v1/domain_blocks

Errors

If access_token is not set.

pub fn instance(&self) -> Result<Instance>[src]

Equivalent to /api/v1/instance

Errors

If access_token is not set.

pub fn verify_credentials(&self) -> Result<Account>[src]

Equivalent to /api/v1/accounts/verify_credentials

Errors

If access_token is not set.

pub fn report(
    &self,
    account_id: &str,
    status_ids: Vec<&str>,
    comment: String
) -> Result<Report>
[src]

Equivalent to /api/v1/reports

Errors

If access_token is not set.

pub fn block_domain(&self, domain: String) -> Result<Empty>[src]

Equivalent to /api/v1/domain_blocks

Errors

If access_token is not set.

pub fn authorize_follow_request(&self, id: &str) -> Result<Empty>[src]

Equivalent to /api/v1/accounts/follow_requests/authorize

Errors

If access_token is not set.

pub fn reject_follow_request(&self, id: &str) -> Result<Empty>[src]

Equivalent to /api/v1/accounts/follow_requests/reject

Errors

If access_token is not set.

pub fn search(&self, q: String, resolve: bool) -> Result<SearchResult>[src]

Equivalent to /api/v1/search

Errors

If access_token is not set.

pub fn follows(&self, uri: Cow<'static, str>) -> Result<Account>[src]

Equivalent to /api/v1/follows

Errors

If access_token is not set.

pub fn clear_notifications(&self) -> Result<Empty>[src]

Equivalent to /api/v1/notifications/clear

Errors

If access_token is not set.

pub fn get_account(&self, id: &str) -> Result<Account>[src]

Equivalent to /api/v1/accounts/{}

Errors

If access_token is not set.

pub fn follow(&self, id: &str) -> Result<Account>[src]

Equivalent to /api/v1/accounts/{}/follow

Errors

If access_token is not set.

pub fn unfollow(&self, id: &str) -> Result<Account>[src]

Equivalent to /api/v1/accounts/{}/unfollow

Errors

If access_token is not set.

pub fn block(&self, id: &str) -> Result<Account>[src]

Equivalent to /api/v1/accounts/{}/block

Errors

If access_token is not set.

pub fn unblock(&self, id: &str) -> Result<Account>[src]

Equivalent to /api/v1/accounts/{}/unblock

Errors

If access_token is not set.

pub fn mute(&self, id: &str) -> Result<Account>[src]

Equivalent to /api/v1/accounts/{}/mute

Errors

If access_token is not set.

pub fn unmute(&self, id: &str) -> Result<Account>[src]

Equivalent to /api/v1/accounts/{}/unmute

Errors

If access_token is not set.

pub fn get_notification(&self, id: &str) -> Result<Notification>[src]

Equivalent to /api/v1/notifications/{}

Errors

If access_token is not set.

pub fn get_status(&self, id: &str) -> Result<Status>[src]

Equivalent to /api/v1/statuses/{}

Errors

If access_token is not set.

pub fn get_context(&self, id: &str) -> Result<Context>[src]

Equivalent to /api/v1/statuses/{}/context

Errors

If access_token is not set.

pub fn get_card(&self, id: &str) -> Result<Card>[src]

Equivalent to /api/v1/statuses/{}/card

Errors

If access_token is not set.

pub fn reblog(&self, id: &str) -> Result<Status>[src]

Equivalent to /api/v1/statuses/{}/reblog

Errors

If access_token is not set.

pub fn unreblog(&self, id: &str) -> Result<Status>[src]

Equivalent to /api/v1/statuses/{}/unreblog

Errors

If access_token is not set.

pub fn favourite(&self, id: &str) -> Result<Status>[src]

Equivalent to /api/v1/statuses/{}/favourite

Errors

If access_token is not set.

pub fn unfavourite(&self, id: &str) -> Result<Status>[src]

Equivalent to /api/v1/statuses/{}/unfavourite

Errors

If access_token is not set.

pub fn delete_status(&self, id: &str) -> Result<Empty>[src]

Equivalent to /api/v1/statuses/{}

Errors

If access_token is not set.

pub fn update_credentials(
    &self,
    changes: CredientialsBuilder
) -> Result<Account>
[src]

pub fn new_status(&self, status: StatusBuilder) -> Result<Status>[src]

Post a new status to the account.

pub fn get_public_timeline(&self, local: bool) -> Result<Vec<Status>>[src]

Get the federated timeline for the instance.

pub fn get_tagged_timeline(
    &self,
    hashtag: String,
    local: bool
) -> Result<Vec<Status>>
[src]

Get timeline filtered by a hashtag(eg. #coffee) either locally or federated.

pub fn statuses<'a, S>(&self, id: &str, request: S) -> Result<Page<Status>> where
    S: Into<Option<StatusesRequest<'a>>>, 
[src]

Get statuses of a single account by id. Optionally only with pictures and or excluding replies.

Example

let client = Mastodon::from_data(data);
let statuses = client.statuses("user-id", None)?;
let client = Mastodon::from_data(data);
let request = StatusesRequest::default()
                              .only_media();
let statuses = client.statuses("user-id", request)?;

pub fn relationships(&self, ids: &[&str]) -> Result<Page<Relationship>>[src]

Returns the client account's relationship to a list of other accounts. Such as whether they follow them or vice versa.

pub fn search_accounts(
    &self,
    query: &str,
    limit: Option<u64>,
    following: bool
) -> Result<Page<Account>>
[src]

Search for accounts by their name. Will lookup an account remotely if the search term is in the username@domain format and not yet in the database.

pub fn media(&self, media_builder: MediaBuilder) -> Result<Attachment>[src]

Equivalent to /api/v1/media

Trait Implementations

impl Clone for Mastodon[src]

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

Performs copy-assignment from source. Read more

impl Debug for Mastodon[src]

impl Deref for Mastodon[src]

type Target = Data

The resulting type after dereferencing.

Auto Trait Implementations

impl Unpin for Mastodon

impl Send for Mastodon

impl Sync for Mastodon

impl !UnwindSafe for Mastodon

impl !RefUnwindSafe for Mastodon

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<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>, 

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