Struct elefren::Mastodon [−][src]
Your mastodon application client, handles all requests to and from Mastodon.
Fields
data: Data
Raw data about your mastodon instance.
Trait Implementations
impl<H: Clone + HttpSend> Clone for Mastodon<H>
[src]
impl<H: Clone + HttpSend> Clone for Mastodon<H>
fn clone(&self) -> Mastodon<H>
[src]
fn clone(&self) -> Mastodon<H>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<H: Debug + HttpSend> Debug for Mastodon<H>
[src]
impl<H: Debug + HttpSend> Debug for Mastodon<H>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl From<Data> for Mastodon<HttpSender>
[src]
impl From<Data> for Mastodon<HttpSender>
impl<H: HttpSend> MastodonClient<H> for Mastodon<H>
[src]
impl<H: HttpSend> MastodonClient<H> for Mastodon<H>
fn favourites(&self) -> Result<Page<Status, H>>
[src]
fn favourites(&self) -> Result<Page<Status, H>>
Equivalent to get /api/v1/favourites
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.favourites();
fn blocks(&self) -> Result<Page<Account, H>>
[src]
fn blocks(&self) -> Result<Page<Account, H>>
Equivalent to get /api/v1/blocks
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.blocks();
fn domain_blocks(&self) -> Result<Page<String, H>>
[src]
fn domain_blocks(&self) -> Result<Page<String, H>>
Equivalent to get /api/v1/domain_blocks
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.domain_blocks();
fn follow_requests(&self) -> Result<Page<Account, H>>
[src]
fn follow_requests(&self) -> Result<Page<Account, H>>
Equivalent to get /api/v1/follow_requests
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.follow_requests();
fn get_home_timeline(&self) -> Result<Page<Status, H>>
[src]
fn get_home_timeline(&self) -> Result<Page<Status, H>>
Equivalent to get /api/v1/timelines/home
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.get_home_timeline();
fn get_emojis(&self) -> Result<Page<Emoji, H>>
[src]
fn get_emojis(&self) -> Result<Page<Emoji, H>>
Equivalent to get /api/v1/custom_emojis
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.get_emojis();
fn mutes(&self) -> Result<Page<Account, H>>
[src]
fn mutes(&self) -> Result<Page<Account, H>>
Equivalent to get /api/v1/mutes
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.mutes();
fn notifications(&self) -> Result<Page<Notification, H>>
[src]
fn notifications(&self) -> Result<Page<Notification, H>>
Equivalent to get /api/v1/notifications
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.notifications();
fn reports(&self) -> Result<Page<Report, H>>
[src]
fn reports(&self) -> Result<Page<Report, H>>
Equivalent to get /api/v1/reports
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.reports();
fn search_accounts<'a>(
&self,
q: &'a str,
limit: Option<u64>,
following: bool
) -> Result<Page<Account, H>>
[src]
fn search_accounts<'a>(
&self,
q: &'a str,
limit: Option<u64>,
following: bool
) -> Result<Page<Account, H>>
fn get_endorsements(&self) -> Result<Page<Account, H>>
[src]
fn get_endorsements(&self) -> Result<Page<Account, H>>
Equivalent to get /api/v1/endorsements
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.get_endorsements();
fn followers(&self, id: &str) -> Result<Page<Account, H>>
[src]
fn followers(&self, id: &str) -> Result<Page<Account, H>>
Equivalent to get /api/v1/accounts/{}/followers
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.followers("some-id");
fn following(&self, id: &str) -> Result<Page<Account, H>>
[src]
fn following(&self, id: &str) -> Result<Page<Account, H>>
Equivalent to get /api/v1/accounts/{}/following
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.following("some-id");
fn reblogged_by(&self, id: &str) -> Result<Page<Account, H>>
[src]
fn reblogged_by(&self, id: &str) -> Result<Page<Account, H>>
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");
fn favourited_by(&self, id: &str) -> Result<Page<Account, H>>
[src]
fn favourited_by(&self, id: &str) -> Result<Page<Account, H>>
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");
fn unblock_domain(&self, domain: String) -> Result<Empty>
[src]
fn unblock_domain(&self, domain: String) -> Result<Empty>
fn instance(&self) -> Result<Instance>
[src]
fn instance(&self) -> Result<Instance>
Equivalent to get /api/v1/instance
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.instance();
fn verify_credentials(&self) -> Result<Account>
[src]
fn verify_credentials(&self) -> Result<Account>
Equivalent to get /api/v1/accounts/verify_credentials
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.verify_credentials();
fn report(
&self,
account_id: &str,
status_ids: Vec<&str>,
comment: String
) -> Result<Report>
[src]
fn report(
&self,
account_id: &str,
status_ids: Vec<&str>,
comment: String
) -> Result<Report>
fn block_domain(&self, domain: String) -> Result<Empty>
[src]
fn block_domain(&self, domain: String) -> Result<Empty>
fn reject_follow_request(&self, id: &str) -> Result<Empty>
[src]
fn reject_follow_request(&self, id: &str) -> Result<Empty>
fn search<'a>(&self, q: &'a str, resolve: bool) -> Result<SearchResult>
[src]
fn search<'a>(&self, q: &'a str, resolve: bool) -> Result<SearchResult>
fn get_public_timeline<'a>(&self, local: bool) -> Result<Vec<Status>>
[src]
fn get_public_timeline<'a>(&self, local: bool) -> Result<Vec<Status>>
fn follows(&self, uri: Cow<'static, str>) -> Result<Account>
[src]
fn follows(&self, uri: Cow<'static, str>) -> Result<Account>
fn media(&self, file: Cow<'static, str>) -> Result<Attachment>
[src]
fn media(&self, file: Cow<'static, str>) -> Result<Attachment>
fn clear_notifications(&self) -> Result<Empty>
[src]
fn clear_notifications(&self) -> Result<Empty>
Equivalent to post /api/v1/notifications/clear
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.clear_notifications();
fn get_push_subscription(&self) -> Result<Subscription>
[src]
fn get_push_subscription(&self) -> Result<Subscription>
Equivalent to get /api/v1/push/subscription
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.get_push_subscription();
fn delete_push_subscription(&self) -> Result<Empty>
[src]
fn delete_push_subscription(&self) -> Result<Empty>
Equivalent to delete /api/v1/push/subscription
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.delete_push_subscription();
fn get_filters(&self) -> Result<Vec<Filter>>
[src]
fn get_filters(&self) -> Result<Vec<Filter>>
Equivalent to get /api/v1/filters
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.get_filters();
fn get_follow_suggestions(&self) -> Result<Vec<Account>>
[src]
fn get_follow_suggestions(&self) -> Result<Vec<Account>>
Equivalent to get /api/v1/suggestions
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.get_follow_suggestions();
fn search_v2<'a>(&self, q: &'a str, resolve: bool) -> Result<SearchResultV2>
[src]
fn search_v2<'a>(&self, q: &'a str, resolve: bool) -> Result<SearchResultV2>
fn get_account(&self, id: u64) -> Result<Account>
[src]
fn get_account(&self, id: u64) -> Result<Account>
Equivalent to get /api/v1/accounts/{}
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.get_account(42);
fn follow(&self, id: u64) -> Result<Account>
[src]
fn follow(&self, id: u64) -> Result<Account>
Equivalent to post /api/v1/accounts/{}/follow
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.follow(42);
fn unfollow(&self, id: u64) -> Result<Relationship>
[src]
fn unfollow(&self, id: u64) -> Result<Relationship>
Equivalent to post /api/v1/accounts/{}/unfollow
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.unfollow(42);
fn block(&self, id: u64) -> Result<Account>
[src]
fn block(&self, id: u64) -> Result<Account>
Equivalent to get /api/v1/accounts/{}/block
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.block(42);
fn unblock(&self, id: u64) -> Result<Account>
[src]
fn unblock(&self, id: u64) -> Result<Account>
Equivalent to get /api/v1/accounts/{}/unblock
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.unblock(42);
fn mute(&self, id: u64) -> Result<Account>
[src]
fn mute(&self, id: u64) -> Result<Account>
Equivalent to get /api/v1/accounts/{}/mute
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.mute(42);
fn unmute(&self, id: u64) -> Result<Account>
[src]
fn unmute(&self, id: u64) -> Result<Account>
Equivalent to get /api/v1/accounts/{}/unmute
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.unmute(42);
fn get_notification(&self, id: u64) -> Result<Notification>
[src]
fn get_notification(&self, id: u64) -> Result<Notification>
Equivalent to get /api/v1/notifications/{}
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.get_notification(42);
fn get_status(&self, id: u64) -> Result<Status>
[src]
fn get_status(&self, id: u64) -> Result<Status>
Equivalent to get /api/v1/statuses/{}
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.get_status(42);
fn get_context(&self, id: u64) -> Result<Context>
[src]
fn get_context(&self, id: u64) -> Result<Context>
Equivalent to get /api/v1/statuses/{}/context
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.get_context(42);
fn get_card(&self, id: u64) -> Result<Card>
[src]
fn get_card(&self, id: u64) -> Result<Card>
Equivalent to get /api/v1/statuses/{}/card
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.get_card(42);
fn reblog(&self, id: u64) -> Result<Status>
[src]
fn reblog(&self, id: u64) -> Result<Status>
Equivalent to post /api/v1/statuses/{}/reblog
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.reblog(42);
fn unreblog(&self, id: u64) -> Result<Status>
[src]
fn unreblog(&self, id: u64) -> Result<Status>
Equivalent to post /api/v1/statuses/{}/unreblog
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.unreblog(42);
fn favourite(&self, id: u64) -> Result<Status>
[src]
fn favourite(&self, id: u64) -> Result<Status>
Equivalent to post /api/v1/statuses/{}/favourite
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.favourite(42);
fn unfavourite(&self, id: u64) -> Result<Status>
[src]
fn unfavourite(&self, id: u64) -> Result<Status>
Equivalent to post /api/v1/statuses/{}/unfavourite
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.unfavourite(42);
fn delete_status(&self, id: u64) -> Result<Empty>
[src]
fn delete_status(&self, id: u64) -> Result<Empty>
Equivalent to delete /api/v1/statuses/{}
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.delete_status(42);
fn get_filter(&self, id: u64) -> Result<Filter>
[src]
fn get_filter(&self, id: u64) -> Result<Filter>
Equivalent to get /api/v1/filters/{}
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.get_filter(42);
fn delete_filter(&self, id: u64) -> Result<Empty>
[src]
fn delete_filter(&self, id: u64) -> Result<Empty>
Equivalent to delete /api/v1/filters/{}
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.delete_filter(42);
fn delete_from_suggestions(&self, id: u64) -> Result<Empty>
[src]
fn delete_from_suggestions(&self, id: u64) -> Result<Empty>
Equivalent to delete /api/v1/suggestions/{}
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.delete_from_suggestions(42);
fn endorse_user(&self, id: u64) -> Result<Relationship>
[src]
fn endorse_user(&self, id: u64) -> Result<Relationship>
Equivalent to post /api/v1/accounts/{}/pin
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.endorse_user(42);
fn unendorse_user(&self, id: u64) -> Result<Relationship>
[src]
fn unendorse_user(&self, id: u64) -> Result<Relationship>
Equivalent to post /api/v1/accounts/{}/unpin
Errors
If access_token
is not set.
let client = Mastodon::from(data); client.unendorse_user(42);
fn add_filter(&self, request: &mut AddFilterRequest) -> Result<Filter>
[src]
fn add_filter(&self, request: &mut AddFilterRequest) -> Result<Filter>
POST /api/v1/filters
fn update_filter(
&self,
id: u64,
request: &mut AddFilterRequest
) -> Result<Filter>
[src]
fn update_filter(
&self,
id: u64,
request: &mut AddFilterRequest
) -> Result<Filter>
PUT /api/v1/filters/:id
fn update_credentials(
&self,
builder: &mut UpdateCredsRequest
) -> Result<Account>
[src]
fn update_credentials(
&self,
builder: &mut UpdateCredsRequest
) -> Result<Account>
PATCH /api/v1/accounts/update_credentials
fn new_status(&self, status: StatusBuilder) -> Result<Status>
[src]
fn new_status(&self, status: StatusBuilder) -> Result<Status>
Post a new status to the account.
fn get_tagged_timeline(
&self,
hashtag: String,
local: bool
) -> Result<Vec<Status>>
[src]
fn get_tagged_timeline(
&self,
hashtag: String,
local: bool
) -> Result<Vec<Status>>
Get timeline filtered by a hashtag(eg. #coffee
) either locally or
federated.
fn statuses<'a, 'b: 'a, S>(
&'b self,
id: &'b str,
request: S
) -> Result<Page<Status, H>> where
S: Into<Option<StatusesRequest<'a>>>,
[src]
fn statuses<'a, 'b: 'a, S>(
&'b self,
id: &'b str,
request: S
) -> Result<Page<Status, H>> where
S: Into<Option<StatusesRequest<'a>>>,
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)?;
fn relationships(&self, ids: &[&str]) -> Result<Page<Relationship, H>>
[src]
fn relationships(&self, ids: &[&str]) -> Result<Page<Relationship, H>>
Returns the client account's relationship to a list of other accounts. Such as whether they follow them or vice versa.
fn add_push_subscription(
&self,
request: &AddPushRequest
) -> Result<Subscription>
[src]
fn add_push_subscription(
&self,
request: &AddPushRequest
) -> Result<Subscription>
Add a push notifications subscription
fn update_push_data(&self, request: &UpdatePushRequest) -> Result<Subscription>
[src]
fn update_push_data(&self, request: &UpdatePushRequest) -> Result<Subscription>
Update the data
portion of the push subscription associated with this
access token
impl<H: HttpSend> Deref for Mastodon<H>
[src]
impl<H: HttpSend> Deref for Mastodon<H>