Struct mammut::Mastodon
[−]
[src]
pub struct Mastodon { /* fields omitted */ }
Methods
impl Mastodon
[src]
fn new<I: Into<String>>(base_url: I) -> Result<Self>
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();
fn register(&mut self, app_builder: AppBuilder) -> Result<()>
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.
fn get_access_token(&mut self, code: String) -> Result<()>
Requires the authorisation code returned from the redirect_url
fn verify(&self) -> Result<Account>
fn blocks(&self) -> Result<Vec<Account>>
fn follow_requests(&self) -> Result<Vec<Account>>
fn mutes(&self) -> Result<Vec<Account>>
fn notifications(&self) -> Result<Vec<Notification>>
fn reports(&self) -> Result<Vec<Report>>
fn get_home_timeline(&self) -> Result<Vec<Status>>
fn allow_follow_request(&self, id: u64) -> Result<Empty>
fn reject_follow_request(&self, id: u64) -> Result<Empty>
fn follows(&self, uri: String) -> Result<Account>
fn clear_notifications(&self) -> Result<Empty>
fn media(&self, file: Vec<u8>) -> Result<Attachment>
fn report(
&self,
account_id: u64,
status_ids: Vec<u64>,
comment: String
) -> Result<Report>
&self,
account_id: u64,
status_ids: Vec<u64>,
comment: String
) -> Result<Report>
fn search(&self, q: String, resolve: bool) -> Result<SearchResult>
fn new_status(&self, status: StatusBuilder) -> Result<Status>
fn get_account(&self, id: u64) -> Result<Account>
fn followers(&self, id: u64) -> Result<Vec<Account>>
fn following(&self, id: u64) -> Result<Vec<Account>>
fn follow(&self, id: u64) -> Result<Account>
fn unfollow(&self, id: u64) -> Result<Account>
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 reblogged_by(&self, id: u64) -> Result<Vec<Account>>
fn favourited_by(&self, id: u64) -> Result<Vec<Account>>
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 get_public_timeline(&self, local: bool) -> Result<Vec<Status>>
fn get_tagged_timeline(
&self,
hashtag: String,
local: bool
) -> Result<Vec<Status>>
&self,
hashtag: String,
local: bool
) -> Result<Vec<Status>>
fn statuses(
&self,
id: u64,
only_media: bool,
exclude_replies: bool
) -> Result<Vec<Status>>
&self,
id: u64,
only_media: bool,
exclude_replies: bool
) -> Result<Vec<Status>>
fn relationships(&self, ids: &[u64]) -> Result<Vec<Relationship>>
fn search_accounts(&self, query: &str) -> Result<Vec<Account>>
fn instance(&self) -> Result<Instance>
Trait Implementations
impl Clone for Mastodon
[src]
fn clone(&self) -> Mastodon
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more