pub struct Mastodon(/* private fields */);
Expand description

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

Implementations§

source§

impl Mastodon

source

pub async fn favourites(&self) -> Result<Page<Status>>

Equivalent to get /api/v1/favourites

§Errors

If access_token is not set.

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

pub async fn bookmarks(&self) -> Result<Page<Status>>

Equivalent to get /api/v1/bookmarks

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.bookmarks();
source

pub async fn blocks(&self) -> Result<Page<Account>>

Equivalent to get /api/v1/blocks

§Errors

If access_token is not set.

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

pub async fn domain_blocks(&self) -> Result<Page<String>>

Equivalent to get /api/v1/domain_blocks

§Errors

If access_token is not set.

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

pub async fn follow_requests(&self) -> Result<Page<Account>>

Equivalent to get /api/v1/follow_requests

§Errors

If access_token is not set.

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

pub async fn get_home_timeline(&self) -> Result<Page<Status>>

Equivalent to get /api/v1/timelines/home

§Errors

If access_token is not set.

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

pub async fn get_emojis(&self) -> Result<Page<Emoji>>

Equivalent to get /api/v1/custom_emojis

§Errors

If access_token is not set.

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

pub async fn mutes(&self) -> Result<Page<Account>>

Equivalent to get /api/v1/mutes

§Errors

If access_token is not set.

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

pub async fn notifications(&self) -> Result<Page<Notification>>

Equivalent to get /api/v1/notifications

§Errors

If access_token is not set.

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

pub async fn reports(&self) -> Result<Page<Report>>

Equivalent to get /api/v1/reports

§Errors

If access_token is not set.

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

pub async fn search_accounts<'a>( &self, q: &'a str, limit: Option<u64>, following: bool ) -> Result<Page<Account>>

Equivalent to get /api/v1/accounts/search

§Errors

If access_token is not set.

source

pub async fn get_endorsements(&self) -> Result<Page<Account>>

Equivalent to get /api/v1/endorsements

§Errors

If access_token is not set.

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

pub async fn followers(&self, id: impl AsRef<str>) -> Result<Page<Account>>

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

§Errors

If access_token is not set.

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

pub async fn following(&self, id: impl AsRef<str>) -> Result<Page<Account>>

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

§Errors

If access_token is not set.

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

pub async fn reblogged_by(&self, id: impl AsRef<str>) -> Result<Page<Account>>

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

§Errors

If access_token is not set.

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

pub async fn favourited_by(&self, id: impl AsRef<str>) -> Result<Page<Account>>

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

§Errors

If access_token is not set.

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

pub async fn unblock_domain(&self, domain: String) -> Result<Empty>

Equivalent to delete /api/v1/domain_blocks

§Errors

If access_token is not set.

source

pub async fn instance(&self) -> Result<Instance>

Equivalent to get /api/v1/instance

§Errors

If access_token is not set.

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

pub async fn verify_credentials(&self) -> Result<Account>

Equivalent to get /api/v1/accounts/verify_credentials

§Errors

If access_token is not set.

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

pub async fn report( &self, account_id: &str, status_ids: Vec<&str>, comment: String ) -> Result<Report>

Equivalent to post /api/v1/reports

§Errors

If access_token is not set.

source

pub async fn block_domain(&self, domain: String) -> Result<Empty>

Equivalent to post /api/v1/domain_blocks

§Errors

If access_token is not set.

source

pub async fn authorize_follow_request(&self, id: &str) -> Result<Empty>

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

§Errors

If access_token is not set.

source

pub async fn reject_follow_request(&self, id: &str) -> Result<Empty>

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

§Errors

If access_token is not set.

source

pub async fn get_public_timeline<'a>(&self, local: bool) -> Result<Vec<Status>>

Equivalent to get /api/v1/timelines/public

§Errors

If access_token is not set.

source

pub async fn follows(&self, uri: Cow<'static, str>) -> Result<Account>

Equivalent to post /api/v1/follows

§Errors

If access_token is not set.

source

pub async fn clear_notifications(&self) -> Result<Empty>

Equivalent to post /api/v1/notifications/clear

§Errors

If access_token is not set.

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

pub async fn get_push_subscription(&self) -> Result<Subscription>

Equivalent to get /api/v1/push/subscription

§Errors

If access_token is not set.

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

pub async fn delete_push_subscription(&self) -> Result<Empty>

Equivalent to delete /api/v1/push/subscription

§Errors

If access_token is not set.

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

pub async fn get_filters(&self) -> Result<Vec<Filter>>

Equivalent to get /api/v1/filters

§Errors

If access_token is not set.

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

pub async fn get_follow_suggestions(&self) -> Result<Vec<Account>>

Equivalent to get /api/v1/suggestions

§Errors

If access_token is not set.

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

pub async fn search<'a>( &self, q: &'a str, resolve: bool ) -> Result<SearchResult>

Equivalent to get /api/v2/search

§Errors

If access_token is not set.

source

pub async fn media( &self, file: impl AsRef<Path>, description: Option<String> ) -> Result<Attachment>

Equivalent to post /api/v2/media, with a description/alt-text.

§Errors

If access_token is not set.

source

pub async fn media_with_thumbnail( &self, file: impl AsRef<Path>, thumbnail: impl AsRef<Path>, description: Option<String> ) -> Result<Attachment>

Equivalent to post /api/v2/media, with a description/alt-text.

§Errors

If access_token is not set.

source

pub async fn get_account(&self, id: &AccountId) -> Result<Account>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.get_account("42");
#   Ok(())
# }
source

pub async fn follow(&self, id: &AccountId) -> Result<Relationship>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.follow("42");
#   Ok(())
# }
source

pub async fn unfollow(&self, id: &AccountId) -> Result<Relationship>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.unfollow("42");
#   Ok(())
# }
source

pub async fn block(&self, id: &AccountId) -> Result<Relationship>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.block("42");
#   Ok(())
# }
source

pub async fn unblock(&self, id: &AccountId) -> Result<Relationship>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.unblock("42");
#   Ok(())
# }
source

pub async fn mute(&self, id: &AccountId) -> Result<Relationship>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.mute("42");
#   Ok(())
# }
source

pub async fn unmute(&self, id: &AccountId) -> Result<Relationship>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.unmute("42");
#   Ok(())
# }
source

pub async fn get_notification( &self, id: &NotificationId ) -> Result<Notification>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.get_notification("42");
#   Ok(())
# }
source

pub async fn dismiss_notification(&self, id: &NotificationId) -> Result<Empty>

Equivalent to post /api/v1/notifications/{}/dismiss

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.dismiss_notification("42");
#   Ok(())
# }
source

pub async fn get_status(&self, id: &StatusId) -> Result<Status>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.get_status("42");
#   Ok(())
# }
source

pub async fn get_context(&self, id: &StatusId) -> Result<Context>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.get_context("42");
#   Ok(())
# }
source

pub async fn get_card(&self, id: &StatusId) -> Result<Card>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.get_card("42");
#   Ok(())
# }
source

pub async fn reblog(&self, id: &StatusId) -> Result<Status>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.reblog("42");
#   Ok(())
# }
source

pub async fn unreblog(&self, id: &StatusId) -> Result<Status>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.unreblog("42");
#   Ok(())
# }
source

pub async fn favourite(&self, id: &StatusId) -> Result<Status>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.favourite("42");
#   Ok(())
# }
source

pub async fn unfavourite(&self, id: &StatusId) -> Result<Status>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.unfavourite("42");
#   Ok(())
# }
source

pub async fn delete_status(&self, id: &StatusId) -> Result<Empty>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.delete_status("42");
#   Ok(())
# }
source

pub async fn get_filter(&self, id: &FilterId) -> Result<Filter>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.get_filter("42");
#   Ok(())
# }
source

pub async fn delete_filter(&self, id: &FilterId) -> Result<Empty>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.delete_filter("42");
#   Ok(())
# }
source

pub async fn delete_from_suggestions(&self, id: &AccountId) -> Result<Empty>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.delete_from_suggestions("42");
#   Ok(())
# }
source

pub async fn endorse_user(&self, id: &AccountId) -> Result<Relationship>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.endorse_user("42");
#   Ok(())
# }
source

pub async fn unendorse_user(&self, id: &AccountId) -> Result<Relationship>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.unendorse_user("42");
#   Ok(())
# }
source

pub async fn attachment(&self, id: &AttachmentId) -> Result<Attachment>

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

§Errors

If access_token is not set.

let data = Data::default();
let client = Mastodon::from(data);
client.attachment("42");
#   Ok(())
# }
source

pub async fn stream_user( &self ) -> Result<impl TryStream<Ok = (Event, Mastodon), Error = Error> + '_>

returns events that are relevant to the authorized user, i.e. home timeline & notifications

Example:

use mastodon_async::prelude::*; use mastodon_async::entities::event::Event; use futures_util::{pin_mut, StreamExt, TryStreamExt};

tokio_test::block_on(async { let data = Data::default(); let client = Mastodon::from(data); let stream = client.stream_user().await.unwrap(); stream.try_for_each(|event| async move { match event { Event::Update(ref status) => { /* .. / }, Event::Notification(ref notification) => { / .. / }, Event::Delete(ref id) => { / .. / }, Event::FiltersChanged => { / .. */ }, } Ok(()) }).await.unwrap(); });

source

pub async fn stream_public( &self ) -> Result<impl TryStream<Ok = (Event, Mastodon), Error = Error> + '_>

All public posts known to the server. Analogous to the federated timeline.

Example:

use mastodon_async::prelude::*; use mastodon_async::entities::event::Event; use futures_util::{pin_mut, StreamExt, TryStreamExt};

tokio_test::block_on(async { let data = Data::default(); let client = Mastodon::from(data); let stream = client.stream_public().await.unwrap(); stream.try_for_each(|event| async move { match event { Event::Update(ref status) => { /* .. / }, Event::Notification(ref notification) => { / .. / }, Event::Delete(ref id) => { / .. / }, Event::FiltersChanged => { / .. */ }, } Ok(()) }).await.unwrap(); });

source

pub async fn stream_public_media( &self ) -> Result<impl TryStream<Ok = (Event, Mastodon), Error = Error> + '_>

All public posts known to the server, filtered for media attachments. Analogous to the federated timeline with ‘only media’ enabled.

Example:

use mastodon_async::prelude::*; use mastodon_async::entities::event::Event; use futures_util::{pin_mut, StreamExt, TryStreamExt};

tokio_test::block_on(async { let data = Data::default(); let client = Mastodon::from(data); let stream = client.stream_public_media().await.unwrap(); stream.try_for_each(|event| async move { match event { Event::Update(ref status) => { /* .. / }, Event::Notification(ref notification) => { / .. / }, Event::Delete(ref id) => { / .. / }, Event::FiltersChanged => { / .. */ }, } Ok(()) }).await.unwrap(); });

source

pub async fn stream_local( &self, only_media: bool ) -> Result<impl TryStream<Ok = (Event, Mastodon), Error = Error> + '_>

All public posts originating from this server.

Example:

use mastodon_async::prelude::*; use mastodon_async::entities::event::Event; use futures_util::{pin_mut, StreamExt, TryStreamExt};

tokio_test::block_on(async { let data = Data::default(); let client = Mastodon::from(data); let stream = client.stream_local(false).await.unwrap(); stream.try_for_each(|event| async move { match event { Event::Update(ref status) => { /* .. / }, Event::Notification(ref notification) => { / .. / }, Event::Delete(ref id) => { / .. / }, Event::FiltersChanged => { / .. */ }, } Ok(()) }).await.unwrap(); });

source

pub async fn stream_remote( &self, only_media: bool ) -> Result<impl TryStream<Ok = (Event, Mastodon), Error = Error> + '_>

All public posts originating from other servers.

Example:

use mastodon_async::prelude::*; use mastodon_async::entities::event::Event; use futures_util::{pin_mut, StreamExt, TryStreamExt};

tokio_test::block_on(async { let data = Data::default(); let client = Mastodon::from(data); let stream = client.stream_remote(false).await.unwrap(); stream.try_for_each(|event| async move { match event { Event::Update(ref status) => { /* .. / }, Event::Notification(ref notification) => { / .. / }, Event::Delete(ref id) => { / .. / }, Event::FiltersChanged => { / .. */ }, } Ok(()) }).await.unwrap(); });

source

pub async fn stream_hashtag( &self, tag: impl AsRef<str> ) -> Result<impl TryStream<Ok = (Event, Mastodon), Error = Error> + '_>

All public posts using a certain hashtag.

Example:

use mastodon_async::prelude::*; use mastodon_async::entities::event::Event; use futures_util::{pin_mut, StreamExt, TryStreamExt};

tokio_test::block_on(async { let data = Data::default(); let client = Mastodon::from(data); let stream = client.stream_hashtag(#bots).await.unwrap(); stream.try_for_each(|event| async move { match event { Event::Update(ref status) => { /* .. / }, Event::Notification(ref notification) => { / .. / }, Event::Delete(ref id) => { / .. / }, Event::FiltersChanged => { / .. */ }, } Ok(()) }).await.unwrap(); });

source

pub async fn stream_local_hashtag( &self, tag: impl AsRef<str> ) -> Result<impl TryStream<Ok = (Event, Mastodon), Error = Error> + '_>

All public posts using a certain hashtag, originating from this server.

Example:

use mastodon_async::prelude::*; use mastodon_async::entities::event::Event; use futures_util::{pin_mut, StreamExt, TryStreamExt};

tokio_test::block_on(async { let data = Data::default(); let client = Mastodon::from(data); let stream = client.stream_local_hashtag(#bots).await.unwrap(); stream.try_for_each(|event| async move { match event { Event::Update(ref status) => { /* .. / }, Event::Notification(ref notification) => { / .. / }, Event::Delete(ref id) => { / .. / }, Event::FiltersChanged => { / .. */ }, } Ok(()) }).await.unwrap(); });

source

pub async fn stream_notifications( &self ) -> Result<impl TryStream<Ok = (Event, Mastodon), Error = Error> + '_>

Notifications for the current user.

Example:

use mastodon_async::prelude::*; use mastodon_async::entities::event::Event; use futures_util::{pin_mut, StreamExt, TryStreamExt};

tokio_test::block_on(async { let data = Data::default(); let client = Mastodon::from(data); let stream = client.stream_notifications().await.unwrap(); stream.try_for_each(|event| async move { match event { Event::Update(ref status) => { /* .. / }, Event::Notification(ref notification) => { / .. / }, Event::Delete(ref id) => { / .. / }, Event::FiltersChanged => { / .. */ }, } Ok(()) }).await.unwrap(); });

source

pub async fn stream_list( &self, list: impl AsRef<str> ) -> Result<impl TryStream<Ok = (Event, Mastodon), Error = Error> + '_>

Updates to a specific list.

Example:

use mastodon_async::prelude::*; use mastodon_async::entities::event::Event; use futures_util::{pin_mut, StreamExt, TryStreamExt};

tokio_test::block_on(async { let data = Data::default(); let client = Mastodon::from(data); let stream = client.stream_list(12345).await.unwrap(); stream.try_for_each(|event| async move { match event { Event::Update(ref status) => { /* .. / }, Event::Notification(ref notification) => { / .. / }, Event::Delete(ref id) => { / .. / }, Event::FiltersChanged => { / .. */ }, } Ok(()) }).await.unwrap(); });

source

pub async fn stream_direct( &self ) -> Result<impl TryStream<Ok = (Event, Mastodon), Error = Error> + '_>

Updates to direct conversations.

Example:

use mastodon_async::prelude::*; use mastodon_async::entities::event::Event; use futures_util::{pin_mut, StreamExt, TryStreamExt};

tokio_test::block_on(async { let data = Data::default(); let client = Mastodon::from(data); let stream = client.stream_direct().await.unwrap(); stream.try_for_each(|event| async move { match event { Event::Update(ref status) => { /* .. / }, Event::Notification(ref notification) => { / .. / }, Event::Delete(ref id) => { / .. / }, Event::FiltersChanged => { / .. */ }, } Ok(()) }).await.unwrap(); });

source

pub fn new(client: Client, data: Data) -> Self

A new instance.

source

pub async fn add_filter(&self, request: &mut AddFilterRequest) -> Result<Filter>

POST /api/v1/filters

source

pub async fn update_filter( &self, id: &str, request: &mut AddFilterRequest ) -> Result<Filter>

PUT /api/v1/filters/:id

source

pub async fn update_credentials( &self, builder: &mut UpdateCredsRequest ) -> Result<Account>

Update the user credentials

source

pub async fn new_status(&self, status: NewStatus) -> Result<Status>

Post a new status to the account.

source

pub async fn get_tagged_timeline( &self, hashtag: String, local: bool ) -> Result<Vec<Status>>

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

source

pub async fn statuses<'a, 'b: 'a>( &'b self, id: &'b AccountId, request: StatusesRequest<'a> ) -> Result<Page<Status>>

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

// Example

use mastodon_async::prelude::*;
tokio_test::block_on(async {
    let data = Data::default();
    let client = Mastodon::from(data);
    let statuses = client.statuses(&AccountId::new("user-id"), Default::default()).await.unwrap();
});
use mastodon_async::prelude::*;
tokio_test::block_on(async {
    let data = Data::default();
    let client = Mastodon::from(data);
    let mut request = StatusesRequest::new();
    request.only_media();
    let statuses = client.statuses(&AccountId::new("user-id"), request).await.unwrap();
});
source

pub async fn relationships( &self, ids: &[&AccountId] ) -> Result<Page<Relationship>>

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

source

pub async fn add_push_subscription( &self, request: &AddPushRequest ) -> Result<Subscription>

Add a push notifications subscription

source

pub async fn update_push_data( &self, request: &UpdatePushRequest ) -> Result<Subscription>

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

source

pub async fn follows_me(&self) -> Result<Page<Account>>

Get all accounts that follow the authenticated user

source

pub async fn followed_by_me(&self) -> Result<Page<Account>>

Get all accounts that the authenticated user follows

source

pub async fn wait_for_processing( &self, attachment: Attachment, polling_time: PollingTime ) -> Result<ProcessedAttachment>

Wait for the media to be done processing and return it with the URL.

Default::default() may be passed as the polling time to select a polling time of 500ms.

§Example
use mastodon_async::prelude::*;
let mastodon = Mastodon::from(Data::default());
tokio_test::block_on(async {
    let attachment = mastodon.media("/path/to/some/file.jpg", None).await.expect("upload");
    let attachment = mastodon.wait_for_processing(attachment, Default::default()).await.expect("processing");
    println!("{}", attachment.url);
});

For a different polling time, use .into() on a std::time::Duration.

use mastodon_async::prelude::*;
use std::time::Duration;
let mastodon = Mastodon::from(Data::default());
tokio_test::block_on(async {
    let attachment = mastodon.media("/path/to/some/file.jpg", None).await.expect("upload");
    let attachment = mastodon.wait_for_processing(
        attachment,
        Duration::from_secs(1).into(),
    ).await.expect("processing");
    println!("{}", attachment.url);
});

Trait Implementations§

source§

impl Clone for Mastodon

source§

fn clone(&self) -> Mastodon

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Mastodon

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for Mastodon

§

type Target = Arc<MastodonClient>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl From<Data> for Mastodon

source§

fn from(data: Data) -> Mastodon

Creates a mastodon instance from the data struct.

source§

impl From<MastodonClient> for Mastodon

source§

fn from(value: MastodonClient) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more