Struct elefren::Mastodon[][src]

pub struct Mastodon<H: HttpSend = HttpSender> {
    pub data: Data,
    // some fields omitted
}

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

Fields

Raw data about your mastodon instance.

Trait Implementations

impl<H: Clone + HttpSend> Clone for Mastodon<H>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<H: Debug + HttpSend> Debug for Mastodon<H>
[src]

Formats the value using the given formatter. Read more

impl From<Data> for Mastodon<HttpSender>
[src]

Creates a mastodon instance from the data struct.

impl<H: HttpSend> MastodonClient<H> for Mastodon<H>
[src]

Equivalent to get /api/v1/favourites

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.favourites();

Equivalent to get /api/v1/blocks

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.blocks();

Equivalent to get /api/v1/domain_blocks

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.domain_blocks();

Equivalent to get /api/v1/follow_requests

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.follow_requests();

Equivalent to get /api/v1/timelines/home

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.get_home_timeline();

Equivalent to get /api/v1/custom_emojis

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.get_emojis();

Equivalent to get /api/v1/mutes

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.mutes();

Equivalent to get /api/v1/notifications

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.notifications();

Equivalent to get /api/v1/reports

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.reports();

Equivalent to get /api/v1/accounts/search

Errors

If access_token is not set.

Equivalent to get /api/v1/endorsements

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.get_endorsements();

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.followers("some-id");

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.following("some-id");

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.reblogged_by("some-id");

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.favourited_by("some-id");

Equivalent to delete /api/v1/domain_blocks

Errors

If access_token is not set.

Equivalent to get /api/v1/instance

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.instance();

Equivalent to get /api/v1/accounts/verify_credentials

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.verify_credentials();

Equivalent to post /api/v1/reports

Errors

If access_token is not set.

Equivalent to post /api/v1/domain_blocks

Errors

If access_token is not set.

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

Errors

If access_token is not set.

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

Errors

If access_token is not set.

Equivalent to get /api/v1/search

Errors

If access_token is not set.

Equivalent to get /api/v1/timelines/public

Errors

If access_token is not set.

Equivalent to post /api/v1/follows

Errors

If access_token is not set.

Equivalent to post /api/v1/media

Errors

If access_token is not set.

Equivalent to post /api/v1/notifications/clear

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.clear_notifications();

Equivalent to get /api/v1/push/subscription

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.get_push_subscription();

Equivalent to delete /api/v1/push/subscription

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.delete_push_subscription();

Equivalent to get /api/v1/filters

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.get_filters();

Equivalent to get /api/v1/suggestions

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.get_follow_suggestions();

Equivalent to get /api/v2/search

Errors

If access_token is not set.

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.get_account(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.follow(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.unfollow(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.block(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.unblock(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.mute(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.unmute(42);

Equivalent to get /api/v1/notifications/{}

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.get_notification(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.get_status(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.get_context(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.get_card(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.reblog(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.unreblog(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.favourite(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.unfavourite(42);

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

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.delete_status(42);

Equivalent to get /api/v1/filters/{}

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.get_filter(42);

Equivalent to delete /api/v1/filters/{}

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.delete_filter(42);

Equivalent to delete /api/v1/suggestions/{}

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.delete_from_suggestions(42);

Equivalent to post /api/v1/accounts/{}/pin

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.endorse_user(42);

Equivalent to post /api/v1/accounts/{}/unpin

Errors

If access_token is not set.

let client = Mastodon::from(data);
client.unendorse_user(42);

POST /api/v1/filters

PUT /api/v1/filters/:id

PATCH /api/v1/accounts/update_credentials

Post a new status to the account.

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

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

Example

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

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

Add a push notifications subscription

Update the data portion of the push subscription associated with this access token

impl<H: HttpSend> Deref for Mastodon<H>
[src]

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

impl<H> Send for Mastodon<H> where
    H: Send

impl<H = HttpSender> !Sync for Mastodon<H>