Struct mammut::Mastodon [] [src]

pub struct Mastodon { /* fields omitted */ }

Methods

impl Mastodon
[src]

Inits new Mastodon object. base_url is expected in the following format https://mastodon.social with no leading forward slash.

use mammut::Mastodon;

let mastodon = Mastodon::new("https://mastodon.social").unwrap();

Register the application with the server from base_url.


use mammut::Mastodon;
use mammut::apps::{AppBuilder, Scope};

let app = AppBuilder {
    client_name: "mammut_test",
    redirect_uris: "urn:ietf:wg:oauth:2.0:oob",
    scopes: Scope::Read,
    website: None,
};

let mut mastodon = Mastodon::new("https://mastodon.social")?;
mastodon.register(app)?;

Returns the full url needed for authorisation. This needs to be opened in a browser.

Requires the authorisation code returned from the redirect_url

Equivalent to /api/v1/ accounts/verify_credentials

Errors

If access_token is not set.

Equivalent to /api/v1/ blocks

Errors

If access_token is not set.

Equivalent to /api/v1/ follow_requests

Errors

If access_token is not set.

Equivalent to /api/v1/ mutes

Errors

If access_token is not set.

Equivalent to /api/v1/ notifications

Errors

If access_token is not set.

Equivalent to /api/v1/ reports

Errors

If access_token is not set.

Equivalent to /api/v1/ timelines/home

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

Equivalent to /api/v1/ follows

Errors

If access_token is not set.

Equivalent to /api/v1/ notifications/clear

Errors

If access_token is not set.

Equivalent to /api/v1/ media

Errors

If access_token is not set.

Equivalent to /api/v1/ reports

Errors

If access_token is not set.

Equivalent to /api/v1/ search

Errors

If access_token is not set.

Equivalent to /api/v1/ statuses

Errors

If access_token is not set.

Equivalent to /api/v1/ accounts/{}

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

Equivalent to /api/v1/ notifications/{}

Errors

If access_token is not set.

Equivalent to /api/v1/ statuses/{}

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

Equivalent to /api/v1/ statuses/{}

Errors

If access_token is not set.

Trait Implementations

impl Clone for Mastodon
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Mastodon
[src]

Formats the value using the given formatter.