Trait elefren::MastodonClient[][src]

pub trait MastodonClient<H: HttpSend = HttpSender> {
    fn favourites(&self) -> Result<Page<Status, H>> { ... }
fn blocks(&self) -> Result<Page<Account, H>> { ... }
fn domain_blocks(&self) -> Result<Page<String, H>> { ... }
fn follow_requests(&self) -> Result<Page<Account, H>> { ... }
fn get_home_timeline(&self) -> Result<Page<Status, H>> { ... }
fn get_emojis(&self) -> Result<Page<Emoji, H>> { ... }
fn mutes(&self) -> Result<Page<Account, H>> { ... }
fn notifications(&self) -> Result<Page<Notification, H>> { ... }
fn reports(&self) -> Result<Page<Report, H>> { ... }
fn followers(&self, id: &str) -> Result<Page<Account, H>> { ... }
fn following(&self, id: &str) -> Result<Page<Account, H>> { ... }
fn reblogged_by(&self, id: &str) -> Result<Page<Account, H>> { ... }
fn favourited_by(&self, id: &str) -> Result<Page<Account, H>> { ... }
fn unblock_domain(&self, domain: String) -> Result<Empty> { ... }
fn instance(&self) -> Result<Instance> { ... }
fn verify_credentials(&self) -> Result<Account> { ... }
fn report(
        &self,
        account_id: &str,
        status_ids: Vec<&str>,
        comment: String
    ) -> Result<Report> { ... }
fn block_domain(&self, domain: String) -> Result<Empty> { ... }
fn authorize_follow_request(&self, id: &str) -> Result<Empty> { ... }
fn reject_follow_request(&self, id: &str) -> Result<Empty> { ... }
fn search<'a>(&self, q: &'a str, resolve: bool) -> Result<SearchResult> { ... }
fn search_v2<'a>(&self, q: &'a str, resolve: bool) -> Result<SearchResultV2> { ... }
fn follows(&self, uri: Cow<'static, str>) -> Result<Account> { ... }
fn media(&self, file: Cow<'static, str>) -> Result<Attachment> { ... }
fn clear_notifications(&self) -> Result<Empty> { ... }
fn get_account(&self, id: u64) -> Result<Account> { ... }
fn follow(&self, id: u64) -> Result<Account> { ... }
fn unfollow(&self, id: u64) -> Result<Relationship> { ... }
fn block(&self, id: u64) -> Result<Account> { ... }
fn unblock(&self, id: u64) -> Result<Account> { ... }
fn mute(&self, id: u64) -> Result<Account> { ... }
fn unmute(&self, id: u64) -> Result<Account> { ... }
fn get_notification(&self, id: u64) -> Result<Notification> { ... }
fn get_status(&self, id: u64) -> Result<Status> { ... }
fn get_context(&self, id: u64) -> Result<Context> { ... }
fn get_card(&self, id: u64) -> Result<Card> { ... }
fn reblog(&self, id: u64) -> Result<Status> { ... }
fn unreblog(&self, id: u64) -> Result<Status> { ... }
fn favourite(&self, id: u64) -> Result<Status> { ... }
fn unfavourite(&self, id: u64) -> Result<Status> { ... }
fn delete_status(&self, id: u64) -> Result<Empty> { ... }
fn update_credentials(
        &self,
        builder: &mut UpdateCredsRequest
    ) -> Result<Account> { ... }
fn new_status(&self, status: StatusBuilder) -> Result<Status> { ... }
fn get_public_timeline(&self, local: bool) -> Result<Vec<Status>> { ... }
fn get_tagged_timeline(
        &self,
        hashtag: String,
        local: bool
    ) -> Result<Vec<Status>> { ... }
fn statuses<'a, 'b: 'a, S>(
        &'b self,
        id: &'b str,
        request: S
    ) -> Result<Page<Status, H>>
    where
        S: Into<Option<StatusesRequest<'a>>>
, { ... }
fn relationships(&self, ids: &[&str]) -> Result<Page<Relationship, H>> { ... }
fn search_accounts(
        &self,
        query: &str,
        limit: Option<u64>,
        following: bool
    ) -> Result<Page<Account, H>> { ... }
fn add_push_subscription(
        &self,
        request: &AddPushRequest
    ) -> Result<Subscription> { ... }
fn update_push_data(
        &self,
        request: &UpdatePushRequest
    ) -> Result<Subscription> { ... }
fn get_push_subscription(&self) -> Result<Subscription> { ... }
fn delete_push_subscription(&self) -> Result<Empty> { ... }
fn get_filters(&self) -> Result<Vec<Filter>> { ... }
fn add_filter(&self, request: &mut AddFilterRequest) -> Result<Filter> { ... }
fn get_filter(&self, id: u64) -> Result<Filter> { ... }
fn update_filter(
        &self,
        id: u64,
        request: &mut AddFilterRequest
    ) -> Result<Filter> { ... }
fn delete_filter(&self, id: u64) -> Result<Empty> { ... }
fn get_follow_suggestions(&self) -> Result<Vec<Account>> { ... }
fn delete_from_suggestions(&self, id: u64) -> Result<Empty> { ... }
fn get_endorsements(&self) -> Result<Page<Account, H>> { ... }
fn endorse_user(&self, id: u64) -> Result<Relationship> { ... }
fn unendorse_user(&self, id: u64) -> Result<Relationship> { ... } }

Represents the set of methods that a Mastodon Client can do, so that implementations might be swapped out for testing

Provided Methods

GET /api/v1/favourites

GET /api/v1/blocks

GET /api/v1/domain_blocks

GET /api/v1/follow_requests

GET /api/v1/timelines/home

GET /api/v1/custom_emojis

GET /api/v1/mutes

GET /api/v1/notifications

GET /api/v1/reports

GET /api/v1/accounts/:id/followers

GET /api/v1/accounts/:id/following

GET /api/v1/statuses/:id/reblogged_by

GET /api/v1/statuses/:id/favourited_by

DELETE /api/v1/domain_blocks

GET /api/v1/instance

GET /api/v1/accounts/verify_credentials

POST /api/v1/reports

POST /api/v1/domain_blocks

POST /api/v1/accounts/follow_requests/authorize

POST /api/v1/accounts/follow_requests/reject

GET /api/v1/search

GET /api/v2/search

POST /api/v1/follows

POST /api/v1/media

POST /api/v1/notifications/clear

GET /api/v1/accounts/:id

POST /api/v1/accounts/:id/follow

POST /api/v1/accounts/:id/unfollow

GET /api/v1/accounts/:id/block

GET /api/v1/accounts/:id/unblock

GET /api/v1/accounts/:id/mute

GET /api/v1/accounts/:id/unmute

GET /api/v1/notifications/:id

GET /api/v1/statuses/:id

GET /api/v1/statuses/:id/context

GET /api/v1/statuses/:id/card

POST /api/v1/statuses/:id/reblog

POST /api/v1/statuses/:id/unreblog

POST /api/v1/statuses/:id/favourite

POST /api/v1/statuses/:id/unfavourite

DELETE /api/v1/statuses/:id

PATCH /api/v1/accounts/update_credentials

POST /api/v1/statuses

GET /api/v1/timelines/public

GET /api/v1/timelines/tag/:hashtag

GET /api/v1/accounts/:id/statuses

GET /api/v1/accounts/relationships

GET /api/v1/accounts/search?q=:query&limit=:limit&following=:following

POST /api/v1/push/subscription

PUT /api/v1/push/subscription

GET /api/v1/push/subscription

DELETE /api/v1/push/subscription

GET /api/v1/filters

POST /api/v1/filters

GET /api/v1/filters/:id

PUT /api/v1/filters/:id

DELETE /api/v1/filters/:id

GET /api/v1/suggestions

DELETE /api/v1/suggestions/:account_id

GET /api/v1/endorsements

POST /api/v1/accounts/:id/pin

POST /api/v1/accounts/:id/unpin

Implementors