ClientExt

Trait ClientExt 

Source
pub trait ClientExt: Client + Sync {
Show 184 methods // Provided methods fn me(&self) -> BoxFuture<'_, Result<User, Error<Self::Error>>> { ... } fn update_me(&self) -> MeUpdateBuilder<&Self> { ... } fn follow( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>> { ... } fn unfollow( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>> { ... } fn mute( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn unmute( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn block( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>> { ... } fn unblock( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>> { ... } fn followers( &self, user: impl EntityRef<User>, ) -> PagerStream<BoxPager<'_, Self, User>> { ... } fn following( &self, user: impl EntityRef<User>, ) -> PagerStream<BoxPager<'_, Self, User>> { ... } fn pin_note( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>> { ... } fn unpin_note( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>> { ... } fn follow_requests( &self, ) -> BoxFuture<'_, Result<Vec<FollowRequest>, Error<Self::Error>>> { ... } fn cancel_follow_request( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>> { ... } fn accept_follow_request( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn reject_follow_request( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn muting_users(&self) -> PagerStream<BoxPager<'_, Self, User>> { ... } fn blocking_users(&self) -> PagerStream<BoxPager<'_, Self, User>> { ... } fn favorited_notes(&self) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn notifications(&self) -> PagerStream<BoxPager<'_, Self, Notification>> { ... } fn user_relation( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<UserRelation, Error<Self::Error>>> { ... } fn is_following( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>> { ... } fn is_followed( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>> { ... } fn is_blocking( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>> { ... } fn is_blocked( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>> { ... } fn is_muted( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>> { ... } fn has_pending_follow_request_from_me( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>> { ... } fn has_pending_follow_request_to_me( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>> { ... } fn get_user( &self, id: Id<User>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>> { ... } fn get_users( &self, ids: impl IntoIterator<Item = Id<User>>, ) -> BoxFuture<'_, Result<Vec<User>, Error<Self::Error>>> { ... } fn report_abuse( &self, user: impl EntityRef<User>, comment: impl Into<String>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn search_users( &self, query: impl Into<String>, ) -> PagerStream<BoxPager<'_, Self, User>> { ... } fn users(&self) -> UserListBuilder<&Self> { ... } fn recommended_users(&self) -> PagerStream<BoxPager<'_, Self, User>> { ... } fn frequently_replied_users( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<Vec<User>, Error<Self::Error>>> { ... } fn pinned_users( &self, ) -> BoxFuture<'_, Result<Vec<User>, Error<Self::Error>>> { ... } fn build_note(&self) -> NoteBuilder<&Self> { ... } fn delete_note( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn get_note( &self, id: Id<Note>, ) -> BoxFuture<'_, Result<Note, Error<Self::Error>>> { ... } fn create_note( &self, text: impl Into<String>, ) -> BoxFuture<'_, Result<Note, Error<Self::Error>>> { ... } fn poll( &self, text: impl Into<String>, choices: impl IntoIterator<Item = impl Into<String>>, ) -> BoxFuture<'_, Result<Note, Error<Self::Error>>> { ... } fn reply( &self, note: impl EntityRef<Note>, text: impl Into<String>, ) -> BoxFuture<'_, Result<Note, Error<Self::Error>>> { ... } fn renote( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<Note, Error<Self::Error>>> { ... } fn quote( &self, note: impl EntityRef<Note>, text: impl Into<String>, ) -> BoxFuture<'_, Result<Note, Error<Self::Error>>> { ... } fn react( &self, note: impl EntityRef<Note>, reaction: impl Into<Reaction>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn unreact( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn favorite( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn unfavorite( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn watch( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn unwatch( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn is_favorited( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>> { ... } fn is_watched( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>> { ... } fn vote( &self, note: impl EntityRef<Note>, choice: u64, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn featured_notes(&self) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn conversation( &self, note: impl EntityRef<Note>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn children_notes( &self, note: impl EntityRef<Note>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn mentioned_notes(&self) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn renotes( &self, note: impl EntityRef<Note>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn replies( &self, note: impl EntityRef<Note>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn search_notes( &self, query: impl Into<String>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn local_notes( &self, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn local_notes_since( &self, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn local_notes_around( &self, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>) { ... } fn global_notes( &self, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn global_notes_since( &self, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn global_notes_around( &self, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>) { ... } fn social_notes( &self, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn social_notes_since( &self, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn social_notes_around( &self, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>) { ... } fn home_notes( &self, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn home_notes_since( &self, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn home_notes_around( &self, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>) { ... } fn user_notes( &self, user: impl EntityRef<User>, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn user_notes_since( &self, user: impl EntityRef<User>, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn user_notes_around( &self, user: impl EntityRef<User>, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>) { ... } fn user_list_notes( &self, list: impl EntityRef<UserList>, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn user_list_notes_since( &self, list: impl EntityRef<UserList>, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn user_list_notes_around( &self, list: impl EntityRef<UserList>, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>) { ... } fn channel_notes( &self, channel: impl EntityRef<Channel>, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn channel_notes_since( &self, channel: impl EntityRef<Channel>, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn channel_notes_around( &self, channel: impl EntityRef<Channel>, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>) { ... } fn tagged_notes( &self, query: impl Into<Query<Tag>>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn local_notes_with_file_types( &self, types: impl IntoIterator<Item = Mime>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn create_user_list( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<UserList, Error<Self::Error>>> { ... } fn delete_user_list( &self, list: impl EntityRef<UserList>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn rename_user_list( &self, list: impl EntityRef<UserList>, name: impl Into<String>, ) -> BoxFuture<'_, Result<UserList, Error<Self::Error>>> { ... } fn get_user_list( &self, id: Id<UserList>, ) -> BoxFuture<'_, Result<UserList, Error<Self::Error>>> { ... } fn push_to_user_list( &self, list: impl EntityRef<UserList>, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn pull_from_user_list( &self, list: impl EntityRef<UserList>, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn create_user_group( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<UserGroup, Error<Self::Error>>> { ... } fn delete_user_group( &self, group: impl EntityRef<UserGroup>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn rename_user_group( &self, group: impl EntityRef<UserGroup>, name: impl Into<String>, ) -> BoxFuture<'_, Result<UserGroup, Error<Self::Error>>> { ... } fn get_user_group( &self, id: Id<UserGroup>, ) -> BoxFuture<'_, Result<UserGroup, Error<Self::Error>>> { ... } fn invite_to_user_group( &self, group: impl EntityRef<UserGroup>, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn pull_from_user_group( &self, group: impl EntityRef<UserGroup>, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn transfer_user_group( &self, group: impl EntityRef<UserGroup>, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<UserGroup, Error<Self::Error>>> { ... } fn user_group_invitations( &self, ) -> PagerStream<BoxPager<'_, Self, UserGroupInvitation>> { ... } fn accept_user_group_invitation( &self, invitation: impl EntityRef<UserGroupInvitation>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn reject_user_group_invitation( &self, invitation: impl EntityRef<UserGroupInvitation>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn joined_user_groups( &self, ) -> BoxFuture<'_, Result<Vec<UserGroup>, Error<Self::Error>>> { ... } fn owned_user_groups( &self, ) -> BoxFuture<'_, Result<Vec<UserGroup>, Error<Self::Error>>> { ... } fn create_antenna( &self, name: impl Into<String>, query: impl Into<Query<String>>, ) -> BoxFuture<'_, Result<Antenna, Error<Self::Error>>> { ... } fn build_antenna(&self) -> AntennaBuilder<&Self> { ... } fn delete_antenna( &self, antenna: impl EntityRef<Antenna>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn get_antenna( &self, id: Id<Antenna>, ) -> BoxFuture<'_, Result<Antenna, Error<Self::Error>>> { ... } fn update_antenna(&self, antenna: Antenna) -> AntennaUpdateBuilder<&Self> { ... } fn antennas( &self, ) -> BoxFuture<'_, Result<Vec<Antenna>, Error<Self::Error>>> { ... } fn antenna_notes( &self, antenna: impl EntityRef<Antenna>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn create_channel( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<Channel, Error<Self::Error>>> { ... } fn build_channel(&self) -> ChannelBuilder<&Self> { ... } fn get_channel( &self, id: Id<Channel>, ) -> BoxFuture<'_, Result<Channel, Error<Self::Error>>> { ... } fn update_channel( &self, channel: impl EntityRef<Channel>, ) -> ChannelUpdateBuilder<&Self> { ... } fn follow_channel( &self, channel: impl EntityRef<Channel>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn unfollow_channel( &self, channel: impl EntityRef<Channel>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn followed_channels(&self) -> PagerStream<BoxPager<'_, Self, Channel>> { ... } fn owned_channels(&self) -> PagerStream<BoxPager<'_, Self, Channel>> { ... } fn featured_channels( &self, ) -> BoxFuture<'_, Result<Vec<Channel>, Error<Self::Error>>> { ... } fn create_clip( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<Clip, Error<Self::Error>>> { ... } fn build_clip(&self) -> ClipBuilder<&Self> { ... } fn delete_clip( &self, clip: impl EntityRef<Clip>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn clips(&self) -> BoxFuture<'_, Result<Vec<Clip>, Error<Self::Error>>> { ... } fn note_clips( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<Vec<Clip>, Error<Self::Error>>> { ... } fn clip_note( &self, clip: impl EntityRef<Clip>, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn clip_notes( &self, clip: impl EntityRef<Clip>, ) -> PagerStream<BoxPager<'_, Self, Note>> { ... } fn get_clip( &self, id: Id<Clip>, ) -> BoxFuture<'_, Result<Clip, Error<Self::Error>>> { ... } fn update_clip(&self, clip: Clip) -> ClipUpdateBuilder<&Self> { ... } fn user_clips( &self, user: impl EntityRef<User>, ) -> PagerStream<BoxPager<'_, Self, Clip>> { ... } fn create_message( &self, recipient: impl EntityRef<User>, text: impl Into<String>, ) -> BoxFuture<'_, Result<MessagingMessage, Error<Self::Error>>> { ... } fn create_group_message( &self, recipient: impl EntityRef<UserGroup>, text: impl Into<String>, ) -> BoxFuture<'_, Result<MessagingMessage, Error<Self::Error>>> { ... } fn build_message(&self) -> MessagingMessageBuilder<&Self> { ... } fn delete_message( &self, message: impl EntityRef<MessagingMessage>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn read_message( &self, message: impl EntityRef<MessagingMessage>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn user_messages( &self, user: impl EntityRef<User>, ) -> PagerStream<BoxPager<'_, Self, MessagingMessage>> { ... } fn group_messages( &self, group: impl EntityRef<UserGroup>, ) -> PagerStream<BoxPager<'_, Self, MessagingMessage>> { ... } fn messaging_history( &self, ) -> BoxFuture<'_, Result<Vec<MessagingMessage>, Error<Self::Error>>> { ... } fn upload_file_from_url( &self, url: Url, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn upload_file_from_url_( &self, url: Url, ) -> BoxFuture<'_, Result<DriveFile, Error<Self::Error>>> { ... } fn build_file_from_url(&self, url: Url) -> DriveFileUrlBuilder<&Self> { ... } fn delete_file( &self, file: impl EntityRef<DriveFile>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn update_file( &self, file: impl EntityRef<DriveFile>, ) -> DriveFileUpdateBuilder<&Self> { ... } fn get_file( &self, id: Id<DriveFile>, ) -> BoxFuture<'_, Result<DriveFile, Error<Self::Error>>> { ... } fn create_folder( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<DriveFolder, Error<Self::Error>>> { ... } fn create_folder_with_parent( &self, name: impl Into<String>, parent: impl EntityRef<DriveFolder>, ) -> BoxFuture<'_, Result<DriveFolder, Error<Self::Error>>> { ... } fn delete_folder( &self, folder: impl EntityRef<DriveFolder>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn update_folder( &self, folder: impl EntityRef<DriveFolder>, ) -> DriveFolderUpdateBuilder<&Self> { ... } fn get_folder( &self, id: Id<DriveFolder>, ) -> BoxFuture<'_, Result<DriveFolder, Error<Self::Error>>> { ... } fn attached_notes( &self, file: impl EntityRef<DriveFile>, ) -> BoxFuture<'_, Result<Vec<Note>, Error<Self::Error>>> { ... } fn find_file_by_name( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<Vec<DriveFile>, Error<Self::Error>>> { ... } fn find_file_by_name_in_folder( &self, name: impl Into<String>, folder: impl EntityRef<DriveFolder>, ) -> BoxFuture<'_, Result<Vec<DriveFile>, Error<Self::Error>>> { ... } fn find_folder_by_name( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<Vec<DriveFolder>, Error<Self::Error>>> { ... } fn find_folder_by_name_in_folder( &self, name: impl Into<String>, folder: impl EntityRef<DriveFolder>, ) -> BoxFuture<'_, Result<Vec<DriveFolder>, Error<Self::Error>>> { ... } fn files(&self) -> DriveFileListBuilder<&Self> { ... } fn folders(&self) -> PagerStream<BoxPager<'_, Self, DriveFolder>> { ... } fn folders_in_folder( &self, folder: impl EntityRef<DriveFolder>, ) -> PagerStream<BoxPager<'_, Self, DriveFolder>> { ... } fn add_moderator( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn remove_moderator( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn promote_note( &self, note: impl EntityRef<Note>, expires_at: DateTime<Utc>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn abuse_user_reports( &self, ) -> PagerStream<BoxPager<'_, Self, AbuseUserReport>> { ... } fn remove_abuse_user_report( &self, report: impl EntityRef<AbuseUserReport>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn resolve_abuse_user_report( &self, report: impl EntityRef<AbuseUserReport>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn server_logs(&self) -> ServerLogListBuilder<&Self> { ... } fn moderation_logs(&self) -> PagerStream<BoxPager<'_, Self, ModerationLog>> { ... } fn silence( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn suspend( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn unsilence( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn unsuspend( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn update_meta(&self) -> MetaUpdateBuilder<&Self> { ... } fn create_announcement( &self, title: impl Into<String>, text: impl Into<String>, ) -> BoxFuture<'_, Result<Announcement, Error<Self::Error>>> { ... } fn create_announcement_with_image( &self, title: impl Into<String>, text: impl Into<String>, image_url: Url, ) -> BoxFuture<'_, Result<Announcement, Error<Self::Error>>> { ... } fn delete_announcement( &self, announcement: impl EntityRef<Announcement>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn update_announcement( &self, announcement: Announcement, ) -> AnnouncementUpdateBuilder<&Self> { ... } fn create_emoji( &self, file: impl EntityRef<DriveFile>, ) -> BoxFuture<'_, Result<Id<Emoji>, Error<Self::Error>>> { ... } fn delete_emoji( &self, emoji: impl EntityRef<Emoji>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn update_emoji(&self, emoji: Emoji) -> EmojiUpdateBuilder<&Self> { ... } fn copy_emoji( &self, emoji: impl EntityRef<Emoji>, ) -> BoxFuture<'_, Result<Id<Emoji>, Error<Self::Error>>> { ... } fn emojis(&self) -> PagerStream<BoxPager<'_, Self, Emoji>> { ... } fn search_emojis( &self, query: impl Into<String>, ) -> PagerStream<BoxPager<'_, Self, Emoji>> { ... } fn meta(&self) -> BoxFuture<'_, Result<Meta, Error<Self::Error>>> { ... } fn announcements(&self) -> PagerStream<BoxPager<'_, Self, Announcement>> { ... } fn featured_pages( &self, ) -> BoxFuture<'_, Result<Vec<Page>, Error<Self::Error>>> { ... } fn user_pages( &self, user: impl EntityRef<User>, ) -> PagerStream<BoxPager<'_, Self, Page>> { ... } fn mark_all_notifications_as_read( &self, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn create_notification( &self, body: impl Into<String>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>> { ... } fn build_notification(&self) -> NotificationBuilder<&Self> { ... }
}
Expand description

An extension trait for Client that provides convenient high-level APIs.

§Streams

Some methods (e.g. followers, local_notes, etc.) return a Stream that uses pagination to fetch all entries. You can use methods from TryStreamExt or StreamExt to work with this.

Provided Methods§

Source

fn me(&self) -> BoxFuture<'_, Result<User, Error<Self::Error>>>

Gets the information of the user who is logged in with this client.

§Examples
let me = client.me().await?;
println!("Logged in as @{}", me.username);
Source

fn update_me(&self) -> MeUpdateBuilder<&Self>

Updates the user logged in with this client.

This method actually returns a builder, namely MeUpdateBuilder. You can chain the method calls to it corresponding to the fields you want to update. Finally, calling update method will actually perform the update. See MeUpdateBuilder for the fields that can be updated.

§Examples
// Flag it as a bot and set the name to "my awesome bot"
let updated = client
    .update_me()
    .bot(true)
    .set_name("my awesome bot")
    .update()
    .await?;

assert!(updated.is_bot);
assert_eq!(updated.name.unwrap(), "my awesome bot");
Source

fn follow( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>>

Follows the specified user.

Source

fn unfollow( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>>

Unfollows the specified user.

Source

fn mute( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Mutes the specified user.

Source

fn unmute( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Unmutes the specified user.

Source

fn block( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>>

Blocks the specified user.

Source

fn unblock( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>>

Unblocks the specified user.

Source

fn followers( &self, user: impl EntityRef<User>, ) -> PagerStream<BoxPager<'_, Self, User>>

Lists the followers of the specified user.

§Examples

This example uses TryStreamExt::try_next and while let to retrieve notifications one after another until there are no more.

use futures::stream::{StreamExt, TryStreamExt};

// In this example, we will fetch all the followers and follow them.
// First, obtain your information to pass to `.follwers` method.
let me = client.me().await?;

// `follwers` variable here is a `Stream` to enumerate first 50 followers of `me`.
let mut followers = client.followers(&me).take(50);

// Retrieve all followers until there are no more.
while let Some(user) = followers.try_next().await? {
    // Follow the `user` if you haven't already.
    if !client.is_following(&user).await? {
        client.follow(&user).await?;
    }
}
Source

fn following( &self, user: impl EntityRef<User>, ) -> PagerStream<BoxPager<'_, Self, User>>

Lists the users that the specified user is following.

Source

fn pin_note( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>>

Pins the specified note to the profile.

Source

fn unpin_note( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>>

Unpins the specified note to the profile.

Source

fn follow_requests( &self, ) -> BoxFuture<'_, Result<Vec<FollowRequest>, Error<Self::Error>>>

Lists the follow requests sent to the user logged in with this client.

§Examples
// Accept all follow requests
for request in client.follow_requests().await? {
    client.accept_follow_request(&request.follower).await?;
}
Source

fn cancel_follow_request( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>>

Cancels the follow request being sent to the specified user.

Source

fn accept_follow_request( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Accepts the follow request that have been received from the specified user.

Source

fn reject_follow_request( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Rejects the follow request that have been received from the specified user.

Source

fn muting_users(&self) -> PagerStream<BoxPager<'_, Self, User>>

Lists the users muted by the user logged in with this client.

Source

fn blocking_users(&self) -> PagerStream<BoxPager<'_, Self, User>>

Lists the users blocked by the user logged in with this client.

Source

fn favorited_notes(&self) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the notes favorited by the user logged in with this client.

Source

fn notifications(&self) -> PagerStream<BoxPager<'_, Self, Notification>>

Lists the notifications to the user logged in with this client.

§Examples

This example uses TryStreamExt::try_next and while let to retrieve notifications one after another until there are no more.

use futures::stream::{StreamExt, TryStreamExt};

// `notifications` here is a `Stream` to enumerate first 10 notifications.
let mut notifications = client.notifications().take(10);
// Retrieve notifications until there are no more.
while let Some(notification) = notifications.try_next().await? {
    // Print some information about the notification.
    println!("notification {}: created at {}", notification.id, notification.created_at);
}
Source

fn user_relation( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<UserRelation, Error<Self::Error>>>

Returns the relationship between the specified user and the user logged in with this client.

The returned UserRelation object records the various information. There are separate methods to examine each relationship (e.g. is_following), so if you are only interested in one relationship, it can be simpler to use those.

Source

fn is_following( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>>

Checks if the specified user is followed by the user logged in with this client.

If you are also interested in other relationships, use user_relation.

let relation = client.user_relation(&user).await?;
assert_eq!(client.is_following(&user).await?, relation.is_following);
Source

fn is_followed( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>>

Checks if the specified user follows the user logged in with this client.

If you are also interested in other relationships, use user_relation.

let relation = client.user_relation(&user).await?;
assert_eq!(client.is_followed(&user).await?, relation.is_followed);
Source

fn is_blocking( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>>

Checks if the specified user is blocked by the user logged in with this client.

If you are also interested in other relationships, use user_relation.

let relation = client.user_relation(&user).await?;
assert_eq!(client.is_blocking(&user).await?, relation.is_blocking);
Source

fn is_blocked( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>>

Checks if the specified user blocks the user logged in with this client.

If you are also interested in other relationships, use user_relation.

let relation = client.user_relation(&user).await?;
assert_eq!(client.is_blocked(&user).await?, relation.is_blocked);
Source

fn is_muted( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>>

Checks if the specified user is muted by the user logged in with this client.

If you are also interested in other relationships, use user_relation.

let relation = client.user_relation(&user).await?;
assert_eq!(client.is_muted(&user).await?, relation.is_muted);
Source

fn has_pending_follow_request_from_me( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>>

Checks if the specified user has a pending follow request from the user logged in with this client.

If you are also interested in other relationships, use user_relation.

let relation = client.user_relation(&user).await?;
assert_eq!(client.has_pending_follow_request_from_me(&user).await?, relation.has_pending_follow_request_from_you);
Source

fn has_pending_follow_request_to_me( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>>

Checks if the specified user has a pending follow request to the user logged in with this client.

If you are also interested in other relationships, use user_relation.

let relation = client.user_relation(&user).await?;
assert_eq!(client.has_pending_follow_request_to_me(&user).await?, relation.has_pending_follow_request_to_you);
Source

fn get_user( &self, id: Id<User>, ) -> BoxFuture<'_, Result<User, Error<Self::Error>>>

Gets the corresponding user from the ID.

Source

fn get_users( &self, ids: impl IntoIterator<Item = Id<User>>, ) -> BoxFuture<'_, Result<Vec<User>, Error<Self::Error>>>

Gets the list of corresponding user from the list of IDs.

Source

fn report_abuse( &self, user: impl EntityRef<User>, comment: impl Into<String>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Reports abuse by the specified user.

Source

fn search_users( &self, query: impl Into<String>, ) -> PagerStream<BoxPager<'_, Self, User>>

Searches for users with the specified query string.

Source

fn users(&self) -> UserListBuilder<&Self>

Lists the users in the instance.

This method actually returns a builder, namely UserListBuilder. You can specify how you want to list users by chaining methods. The list method of the builder returns a Stream that lists users in the specified way.

§Examples
use futures::stream::TryStreamExt;
use misskey::model::user::{User, UserSortKey};

// Get a list of local moderator users sorted by number of followers.
let users: Vec<User> = client
    .users()
    .local()
    .moderator()
    .sort_by_followers()
    .list()
    .try_collect()
    .await?;
Source

fn recommended_users(&self) -> PagerStream<BoxPager<'_, Self, User>>

Lists the recommended users of the instance.

Source

fn frequently_replied_users( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<Vec<User>, Error<Self::Error>>>

Lists the users who frequently reply to the specified user.

Source

fn pinned_users(&self) -> BoxFuture<'_, Result<Vec<User>, Error<Self::Error>>>

Lists the users pinned to the instance.

Source

fn build_note(&self) -> NoteBuilder<&Self>

Returns a builder for composing a note.

The returned builder provides methods to customize details of the note, and you can chain them to compose a note incrementally. Finally, calling create method will actually create a note. See NoteBuilder for the provided methods.

§Examples
let note = client
    .build_note()
    .text("Hello, World")
    .followers_only()
    .create()
    .await?;

assert_eq!(note.text.unwrap(), "Hello, World");
Source

fn delete_note( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Deletes the specified note.

§Examples
let note = client.create_note("Oops!").await?;
client.delete_note(&note).await?;
Source

fn get_note( &self, id: Id<Note>, ) -> BoxFuture<'_, Result<Note, Error<Self::Error>>>

Gets the corresponding note from the ID.

Source

fn create_note( &self, text: impl Into<String>, ) -> BoxFuture<'_, Result<Note, Error<Self::Error>>>

Creates a note with the given text.

§Examples
let note = client.create_note("Hello, Misskey!").await?;
assert_eq!(note.text.unwrap(), "Hello, Misskey!");
Source

fn poll( &self, text: impl Into<String>, choices: impl IntoIterator<Item = impl Into<String>>, ) -> BoxFuture<'_, Result<Note, Error<Self::Error>>>

Creates a poll with the given text and choices.

§Examples
let note = client
    .poll("Which fruit is your favorite?", vec!["Apple", "Orange", "Banana"])
    .await?;
Source

fn reply( &self, note: impl EntityRef<Note>, text: impl Into<String>, ) -> BoxFuture<'_, Result<Note, Error<Self::Error>>>

Creates a reply note with the given text.

Source

fn renote( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<Note, Error<Self::Error>>>

Creates a renote.

Source

fn quote( &self, note: impl EntityRef<Note>, text: impl Into<String>, ) -> BoxFuture<'_, Result<Note, Error<Self::Error>>>

Creates a quote note with the given text.

Source

fn react( &self, note: impl EntityRef<Note>, reaction: impl Into<Reaction>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Adds the reaction to the specified note.

Source

fn unreact( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Deletes a reaction from the specified note.

Source

fn favorite( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Favorites the specified note.

Source

fn unfavorite( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Unfavorites the specified note.

Source

fn watch( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Watches the specified note.

Source

fn unwatch( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Unwatches the specified note.

Source

fn is_favorited( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>>

Checks if the specified note is favorited by the user logged in with this client.

Source

fn is_watched( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<bool, Error<Self::Error>>>

Checks if the specified note is watched by the user logged in with this client.

Source

fn vote( &self, note: impl EntityRef<Note>, choice: u64, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Vote on the specified note.

Source

fn featured_notes(&self) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the featured notes.

Source

fn conversation( &self, note: impl EntityRef<Note>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the notes of the conversation.

Source

fn children_notes( &self, note: impl EntityRef<Note>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the reply notes to the specified note.

Source

fn mentioned_notes(&self) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the notes that are mentioning the account you are logged into with this client.

Source

fn renotes( &self, note: impl EntityRef<Note>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the renotes of the specified note.

Source

fn replies( &self, note: impl EntityRef<Note>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the replies to the specified note.

Source

fn search_notes( &self, query: impl Into<String>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Searches for notes with the specified query string.

Source

fn local_notes( &self, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the notes in the specified range of the local timeline.

The bound Into<TimelineRange<Note>> on the argument type is satisfied by the type of some range expressions such as .. or start.. (which are desugared into RangeFull and RangeFrom respectively). A note or DateTime<Utc> can be used to specify the start and end bounds of the range.

§Examples
use futures::stream::{StreamExt, TryStreamExt};

// `notes` variable here is a `Stream` to enumerate first 100 local notes.
let mut notes = client.local_notes(..).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
use chrono::Utc;

// Get the local notes since `time`.
let time = Utc::today().and_hms(0, 0, 0);
let mut notes = client.local_notes(time..);
Source

fn local_notes_since( &self, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists all notes since the specified point in the local timeline in reverse order (i.e. the old note comes first, the new note comes after).

§Examples
use futures::stream::{StreamExt, TryStreamExt};
use chrono::Utc;

let time = Utc::today().and_hms(0, 0, 0);

// `notes_since` is a `Stream` to enumerate first 100 local notes since `time` in reverse order.
let mut notes_since = client.local_notes_since(time).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes_since.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
Source

fn local_notes_around( &self, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>)

Returns a set of streams that fetch notes around the specified point in the local timeline in both directions.

Source

fn global_notes( &self, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the notes in the specified range of the global timeline.

The bound Into<TimelineRange<Note>> on the argument type is satisfied by the type of some range expressions such as .. or start.. (which are desugared into RangeFull and RangeFrom respectively). A note or DateTime<Utc> can be used to specify the start and end bounds of the range.

§Examples
use futures::stream::{StreamExt, TryStreamExt};

// `notes` variable here is a `Stream` to enumerate first 100 global notes.
let mut notes = client.global_notes(..).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
use chrono::Utc;

// Get the global notes since `time`.
let time = Utc::today().and_hms(0, 0, 0);
let mut notes = client.global_notes(time..);
Source

fn global_notes_since( &self, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists all notes since the specified point in the global timeline in reverse order (i.e. the old note comes first, the new note comes after).

§Examples
use futures::stream::{StreamExt, TryStreamExt};
use chrono::Utc;

let time = Utc::today().and_hms(0, 0, 0);

// `notes_since` is a `Stream` to enumerate first 100 global notes since `time` in reverse order.
let mut notes_since = client.global_notes_since(time).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes_since.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
Source

fn global_notes_around( &self, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>)

Returns a set of streams that fetch notes around the specified point in the global timeline in both directions.

Source

fn social_notes( &self, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the notes in the specified range of the social timeline.

The bound Into<TimelineRange<Note>> on the argument type is satisfied by the type of some range expressions such as .. or start.. (which are desugared into RangeFull and RangeFrom respectively). A note or DateTime<Utc> can be used to specify the start and end bounds of the range.

§Examples
use futures::stream::{StreamExt, TryStreamExt};

// `notes` variable here is a `Stream` to enumerate first 100 social notes.
let mut notes = client.social_notes(..).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
use chrono::Utc;

// Get the social notes since `time`.
let time = Utc::today().and_hms(0, 0, 0);
let mut notes = client.social_notes(time..);
Source

fn social_notes_since( &self, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists all notes since the specified point in the social timeline in reverse order (i.e. the old note comes first, the new note comes after).

§Examples
use futures::stream::{StreamExt, TryStreamExt};
use chrono::Utc;

let time = Utc::today().and_hms(0, 0, 0);

// `notes_since` is a `Stream` to enumerate first 100 social notes since `time` in reverse order.
let mut notes_since = client.social_notes_since(time).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes_since.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
Source

fn social_notes_around( &self, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>)

Returns a set of streams that fetch notes around the specified point in the social timeline in both directions.

Source

fn home_notes( &self, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the notes in the specified range of the home timeline.

The bound Into<TimelineRange<Note>> on the argument type is satisfied by the type of some range expressions such as .. or start.. (which are desugared into RangeFull and RangeFrom respectively). A note or DateTime<Utc> can be used to specify the start and end bounds of the range.

§Examples
use futures::stream::{StreamExt, TryStreamExt};

// `notes` variable here is a `Stream` to enumerate first 100 home notes.
let mut notes = client.home_notes(..).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
use chrono::Utc;

// Get the home notes since `time`.
let time = Utc::today().and_hms(0, 0, 0);
let mut notes = client.home_notes(time..);
Source

fn home_notes_since( &self, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists all notes since the specified point in the home timeline in reverse order (i.e. the old note comes first, the new note comes after).

§Examples
use futures::stream::{StreamExt, TryStreamExt};
use chrono::Utc;

let time = Utc::today().and_hms(0, 0, 0);

// `notes_since` is a `Stream` to enumerate first 100 home notes since `time` in reverse order.
let mut notes_since = client.home_notes_since(time).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes_since.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
Source

fn home_notes_around( &self, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>)

Returns a set of streams that fetch notes around the specified point in the home timeline in both directions.

Source

fn user_notes( &self, user: impl EntityRef<User>, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the notes in the specified range of the user timeline.

The bound Into<TimelineRange<Note>> on the argument type is satisfied by the type of some range expressions such as .. or start.. (which are desugared into RangeFull and RangeFrom respectively). A note or DateTime<Utc> can be used to specify the start and end bounds of the range.

§Examples
use futures::stream::{StreamExt, TryStreamExt};

// `notes` variable here is a `Stream` to enumerate first 100 user notes.
let mut notes = client.user_notes(&user, ..).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
use chrono::Utc;

// Get the user notes since `time`.
let time = Utc::today().and_hms(0, 0, 0);
let mut notes = client.user_notes(&user, time..);
Source

fn user_notes_since( &self, user: impl EntityRef<User>, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists all notes since the specified point in the user timeline in reverse order (i.e. the old note comes first, the new note comes after).

§Examples
use futures::stream::{StreamExt, TryStreamExt};
use chrono::Utc;

let time = Utc::today().and_hms(0, 0, 0);

// `notes_since` is a `Stream` to enumerate first 100 user notes since `time` in reverse order.
let mut notes_since = client.user_notes_since(&user, time).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes_since.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
Source

fn user_notes_around( &self, user: impl EntityRef<User>, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>)

Returns a set of streams that fetch notes around the specified point in the user timeline in both directions.

Source

fn user_list_notes( &self, list: impl EntityRef<UserList>, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the notes in the specified range of the user_list timeline.

The bound Into<TimelineRange<Note>> on the argument type is satisfied by the type of some range expressions such as .. or start.. (which are desugared into RangeFull and RangeFrom respectively). A note or DateTime<Utc> can be used to specify the start and end bounds of the range.

§Examples
use futures::stream::{StreamExt, TryStreamExt};

// `notes` variable here is a `Stream` to enumerate first 100 user_list notes.
let mut notes = client.user_list_notes(&list, ..).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
use chrono::Utc;

// Get the user_list notes since `time`.
let time = Utc::today().and_hms(0, 0, 0);
let mut notes = client.user_list_notes(&list, time..);
Source

fn user_list_notes_since( &self, list: impl EntityRef<UserList>, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists all notes since the specified point in the user_list timeline in reverse order (i.e. the old note comes first, the new note comes after).

§Examples
use futures::stream::{StreamExt, TryStreamExt};
use chrono::Utc;

let time = Utc::today().and_hms(0, 0, 0);

// `notes_since` is a `Stream` to enumerate first 100 user_list notes since `time` in reverse order.
let mut notes_since = client.user_list_notes_since(&list, time).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes_since.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
Source

fn user_list_notes_around( &self, list: impl EntityRef<UserList>, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>)

Returns a set of streams that fetch notes around the specified point in the user_list timeline in both directions.

Source

fn channel_notes( &self, channel: impl EntityRef<Channel>, range: impl Into<TimelineRange<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the notes in the specified range of the channel timeline.

The bound Into<TimelineRange<Note>> on the argument type is satisfied by the type of some range expressions such as .. or start.. (which are desugared into RangeFull and RangeFrom respectively). A note or DateTime<Utc> can be used to specify the start and end bounds of the range.

§Examples
use futures::stream::{StreamExt, TryStreamExt};

// `notes` variable here is a `Stream` to enumerate first 100 channel notes.
let mut notes = client.channel_notes(&channel, ..).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
use chrono::Utc;

// Get the channel notes since `time`.
let time = Utc::today().and_hms(0, 0, 0);
let mut notes = client.channel_notes(&channel, time..);
Source

fn channel_notes_since( &self, channel: impl EntityRef<Channel>, since: impl Into<TimelineCursor<Note>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists all notes since the specified point in the channel timeline in reverse order (i.e. the old note comes first, the new note comes after).

§Examples
use futures::stream::{StreamExt, TryStreamExt};
use chrono::Utc;

let time = Utc::today().and_hms(0, 0, 0);

// `notes_since` is a `Stream` to enumerate first 100 channel notes since `time` in reverse order.
let mut notes_since = client.channel_notes_since(&channel, time).take(100);

// Retrieve all notes until there are no more.
while let Some(note) = notes_since.try_next().await? {
    // Print the text of the note, if any.
    if let Some(text) = note.text {
        println!("@{}: {}", note.user.username, text);
    }
}
Source

fn channel_notes_around( &self, channel: impl EntityRef<Channel>, cursor: impl Into<TimelineCursor<Note>>, ) -> (PagerStream<BoxPager<'_, Self, Note>>, PagerStream<BoxPager<'_, Self, Note>>)

Returns a set of streams that fetch notes around the specified point in the channel timeline in both directions.

Source

fn tagged_notes( &self, query: impl Into<Query<Tag>>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the notes with tags as specified in the given query.

§Examples
// Get all notes with the "linux" tag.
let mut notes = client.tagged_notes("linux");
use misskey::model::query::Query;

// Get all notes tagged with "test" or "bot".
let mut notes = client.tagged_notes(Query::atom("test").or("bot"));
Source

fn local_notes_with_file_types( &self, types: impl IntoIterator<Item = Mime>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the local notes with the given file types.

§Examples
use mime::IMAGE_STAR;

// Get all local notes with image files.
let mut notes = client.local_notes_with_file_types(vec![IMAGE_STAR]);
Source

fn create_user_list( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<UserList, Error<Self::Error>>>

Creates a user list with the given name.

§Examples
let list = client.create_user_list("list").await?;
assert_eq!(list.name, "list");
Source

fn delete_user_list( &self, list: impl EntityRef<UserList>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Deletes the specified user list.

§Examples
let list = client.create_user_list("list").await?;
client.delete_user_list(&list).await?;
Source

fn rename_user_list( &self, list: impl EntityRef<UserList>, name: impl Into<String>, ) -> BoxFuture<'_, Result<UserList, Error<Self::Error>>>

Updates the name of the specified user list to the given one.

§Examples
let list = client.create_user_list("list").await?;
let renamed_list = client.rename_user_list(&list, "list2").await?;
assert_eq!(renamed_list.name, "list2");
Source

fn get_user_list( &self, id: Id<UserList>, ) -> BoxFuture<'_, Result<UserList, Error<Self::Error>>>

Gets the corresponding user list from the ID.

Source

fn push_to_user_list( &self, list: impl EntityRef<UserList>, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Adds the user from the specified user list.

Source

fn pull_from_user_list( &self, list: impl EntityRef<UserList>, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Deletes the user from the specified user list.

Source

fn create_user_group( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<UserGroup, Error<Self::Error>>>

Creates a user group with the given name.

§Examples
let group = client.create_user_group("group").await?;
assert_eq!(group.name, "group");
Source

fn delete_user_group( &self, group: impl EntityRef<UserGroup>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Deletes the specified user group.

§Examples
let group = client.create_user_group("group").await?;
client.delete_user_group(&group).await?;
Source

fn rename_user_group( &self, group: impl EntityRef<UserGroup>, name: impl Into<String>, ) -> BoxFuture<'_, Result<UserGroup, Error<Self::Error>>>

Updates the name of the specified user group to the given one.

§Examples
let group = client.create_user_group("group").await?;
let renamed_group = client.rename_user_group(&group, "group2").await?;
assert_eq!(renamed_group.name, "group2");
Source

fn get_user_group( &self, id: Id<UserGroup>, ) -> BoxFuture<'_, Result<UserGroup, Error<Self::Error>>>

Gets the corresponding user group from the ID.

Source

fn invite_to_user_group( &self, group: impl EntityRef<UserGroup>, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Invites the user to the specified user group.

Source

fn pull_from_user_group( &self, group: impl EntityRef<UserGroup>, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Deletes the user from the specified user group.

Note that the owner of the group cannot be deleted. If you want to do so, you first need to transfer the group with transfer_user_group.

Source

fn transfer_user_group( &self, group: impl EntityRef<UserGroup>, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<UserGroup, Error<Self::Error>>>

Transfers the specified user group.

Note that you can only transfer the group to one of its members.

Source

fn user_group_invitations( &self, ) -> PagerStream<BoxPager<'_, Self, UserGroupInvitation>>

Lists the user group invitations sent to the user who is logged in with this client.

§Examples

This example uses TryStreamExt::try_next and while let to retrieve invitations one after another until there are no more.

use futures::stream::TryStreamExt;

// `invitations` here is a `Stream` to enumerate all the invitations.
let mut invitations = client.user_group_invitations();
// Retrieve invitations until there are no more.
while let Some(invitation) = invitations.try_next().await? {
    // Accept the invitation.
    client.accept_user_group_invitation(&invitation).await?;
}
Source

fn accept_user_group_invitation( &self, invitation: impl EntityRef<UserGroupInvitation>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Accepts the specified user group invitation sent to the user logged in with this client.

Source

fn reject_user_group_invitation( &self, invitation: impl EntityRef<UserGroupInvitation>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Rejects the specified user group invitation sent to the user logged in with this client.

Source

fn joined_user_groups( &self, ) -> BoxFuture<'_, Result<Vec<UserGroup>, Error<Self::Error>>>

Lists the user groups joined by the user logged in with this client.

Source

fn owned_user_groups( &self, ) -> BoxFuture<'_, Result<Vec<UserGroup>, Error<Self::Error>>>

Lists the user groups owned by the user logged in with this client.

Source

fn create_antenna( &self, name: impl Into<String>, query: impl Into<Query<String>>, ) -> BoxFuture<'_, Result<Antenna, Error<Self::Error>>>

Creates an antenna with the given name and query.

§Examples
use misskey::model::query::Query;

// Create an antenna for notes containing "misskey" or "msky"
let antenna = client
    .create_antenna("misskey antenna", Query::atom("misskey").or("msky"))
    .await?;

assert_eq!(antenna.name, "misskey antenna");
Source

fn build_antenna(&self) -> AntennaBuilder<&Self>

Returns a builder for creating an antenna.

The returned builder provides methods to customize details of the antenna, and you can chain them to create an antenna incrementally. Finally, calling create method will actually create an antenna. See AntennaBuilder for the provided methods.

§Examples
// Create an antenna for non-reply notes in home timeline that include "misskey"
let antenna = client
    .build_antenna()
    .name("misskey antenna")
    .include("misskey")
    .home()
    .exclude_replies(true)
    .create()
    .await?;

assert_eq!(antenna.name, "misskey antenna");
Source

fn delete_antenna( &self, antenna: impl EntityRef<Antenna>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Deletes the specified antenna.

§Examples
let antenna = client
    .create_antenna("antenna", "misskey")
    .await?;
client.delete_antenna(&antenna).await?;
Source

fn get_antenna( &self, id: Id<Antenna>, ) -> BoxFuture<'_, Result<Antenna, Error<Self::Error>>>

Gets the corresponding antenna from the ID.

Source

fn update_antenna(&self, antenna: Antenna) -> AntennaUpdateBuilder<&Self>

Updates the antenna.

This method actually returns a builder, namely AntennaUpdateBuilder. You can chain the method calls to it corresponding to the fields you want to update. Finally, calling update method will actually perform the update. See AntennaUpdateBuilder for the fields that can be updated.

§Examples
let antenna = client
    .create_antenna("antenna", "misskey")
    .await?;

// Change source and case sensitivity of the antenna
client
    .update_antenna(antenna)
    .case_sensitive(true)
    .all()
    .update()
    .await?;
Source

fn antennas(&self) -> BoxFuture<'_, Result<Vec<Antenna>, Error<Self::Error>>>

Lists the antennas created by the user logged in with this client.

Source

fn antenna_notes( &self, antenna: impl EntityRef<Antenna>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the notes that hit the specified antenna.

Source

fn create_channel( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<Channel, Error<Self::Error>>>

Available on crate feature 12-47-0 only.

Creates a channel with the given name.

§Examples
let channel = client.create_channel("name").await?;
assert_eq!(channel.name, "name");
Source

fn build_channel(&self) -> ChannelBuilder<&Self>

Available on crate feature 12-47-0 only.

Returns a builder for creating a channel.

The returned builder provides methods to customize details of the channel, and you can chain them to create a channel incrementally. Finally, calling create method will actually create a channel. See ChannelBuilder for the provided methods.

§Examples
let channel = client
    .build_channel()
    .name("bot devs")
    .description("Let's talk about Misskey's bot development!")
    .create()
    .await?;

assert_eq!(channel.name, "bot devs");
Source

fn get_channel( &self, id: Id<Channel>, ) -> BoxFuture<'_, Result<Channel, Error<Self::Error>>>

Available on crate feature 12-47-0 only.

Gets the corresponding channel from the ID.

Source

fn update_channel( &self, channel: impl EntityRef<Channel>, ) -> ChannelUpdateBuilder<&Self>

Available on crate feature 12-47-0 only.

Updates the specified channel.

This method actually returns a builder, namely ChannelUpdateBuilder. You can chain the method calls to it corresponding to the fields you want to update. Finally, calling update method will actually perform the update. See ChannelUpdateBuilder for the fields that can be updated.

§Examples
let channel = client.create_channel("feedback").await?;
client
    .update_channel(&channel)
    .set_description("Give us feedback on the instance.")
    .update()
    .await?;
Source

fn follow_channel( &self, channel: impl EntityRef<Channel>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Available on crate feature 12-47-0 only.

Follows the specified channel.

Source

fn unfollow_channel( &self, channel: impl EntityRef<Channel>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Available on crate feature 12-47-0 only.

Unfollows the specified channel.

Source

fn followed_channels(&self) -> PagerStream<BoxPager<'_, Self, Channel>>

Available on crate feature 12-48-0 only.

Lists the channels followed by the user logged in with this client.

Source

fn owned_channels(&self) -> PagerStream<BoxPager<'_, Self, Channel>>

Available on crate feature 12-48-0 only.

Lists the channels owned by the user logged in with this client.

Source

fn featured_channels( &self, ) -> BoxFuture<'_, Result<Vec<Channel>, Error<Self::Error>>>

Available on crate feature 12-47-0 only.

Lists the featured channels.

Source

fn create_clip( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<Clip, Error<Self::Error>>>

Creates a clip with the given name.

§Examples
let clip = client.create_clip("name").await?;
assert_eq!(clip.name, "name");
Source

fn build_clip(&self) -> ClipBuilder<&Self>

Available on crate feature 12-57-0 only.

Returns a builder for creating a clip.

The returned builder provides methods to customize details of the clip, and you can chain them to create a clip incrementally. Finally, calling create method will actually create a clip. See ClipBuilder for the provided methods.

§Examples
let clip = client
    .build_clip()
    .name("kawaii notes")
    .public(true)
    .create()
    .await?;

assert_eq!(clip.name, "kawaii notes");
Source

fn delete_clip( &self, clip: impl EntityRef<Clip>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Deletes the specified clip.

§Examples
let clip = client.create_clip("Oops!").await?;
client.delete_clip(&clip).await?;
Source

fn clips(&self) -> BoxFuture<'_, Result<Vec<Clip>, Error<Self::Error>>>

Lists the clips created by the user logged in with this client.

Source

fn note_clips( &self, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<Vec<Clip>, Error<Self::Error>>>

Available on crate feature 12-58-0 only.

Lists the clips that contain the specified note.

Source

fn clip_note( &self, clip: impl EntityRef<Clip>, note: impl EntityRef<Note>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Available on crate feature 12-57-0 only.

Clips the specified note.

Source

fn clip_notes( &self, clip: impl EntityRef<Clip>, ) -> PagerStream<BoxPager<'_, Self, Note>>

Lists the notes that are clipped to the specified clip.

Source

fn get_clip( &self, id: Id<Clip>, ) -> BoxFuture<'_, Result<Clip, Error<Self::Error>>>

Gets the corresponding clip from the ID.

Source

fn update_clip(&self, clip: Clip) -> ClipUpdateBuilder<&Self>

Available on crate feature 12-57-0 only.

Updates the specified clip.

This method actually returns a builder, namely ClipUpdateBuilder. You can chain the method calls to it corresponding to the fields you want to update. Finally, calling update method will actually perform the update. See ClipUpdateBuilder for the fields that can be updated.

§Examples
let clip = client.create_clip("kawaii notes").await?;
// Update the description and publish it.
client
    .update_clip(clip)
    .public(true)
    .description("collection of kawaii notes")
    .update()
    .await?;
Source

fn user_clips( &self, user: impl EntityRef<User>, ) -> PagerStream<BoxPager<'_, Self, Clip>>

Available on crate feature 12-61-0 only.

Lists the clips created by the specified user.

Source

fn create_message( &self, recipient: impl EntityRef<User>, text: impl Into<String>, ) -> BoxFuture<'_, Result<MessagingMessage, Error<Self::Error>>>

Sends a message to the user with the given text.

Source

fn create_group_message( &self, recipient: impl EntityRef<UserGroup>, text: impl Into<String>, ) -> BoxFuture<'_, Result<MessagingMessage, Error<Self::Error>>>

Sends a message to the user group with the given text.

Source

fn build_message(&self) -> MessagingMessageBuilder<&Self>

Returns a builder for creating a message.

The returned builder provides methods to customize details of the message and its recipients, and you can chain them to create a message incrementally. Finally, calling create method will actually create and send a message. See MessagingMessageBuilder for the provided methods.

Source

fn delete_message( &self, message: impl EntityRef<MessagingMessage>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Deletes the specified message.

Source

fn read_message( &self, message: impl EntityRef<MessagingMessage>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Marks the specified message as read.

Source

fn user_messages( &self, user: impl EntityRef<User>, ) -> PagerStream<BoxPager<'_, Self, MessagingMessage>>

Lists the messages with the specified user.

Source

fn group_messages( &self, group: impl EntityRef<UserGroup>, ) -> PagerStream<BoxPager<'_, Self, MessagingMessage>>

Lists the messages in the specified user group.

Source

fn messaging_history( &self, ) -> BoxFuture<'_, Result<Vec<MessagingMessage>, Error<Self::Error>>>

Gets message logs for the user who is logged in with this client.

Source

fn upload_file_from_url( &self, url: Url, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Available on crate feature 12-48-0 only.

Uploads the file from the given url to the drive.

The difference between upload_file_from_url_ and this method is that the former can get the DriveFile of the uploaded file, while the latter cannot. If you want to obtain the DriveFile of an uploaded file in v12.48.0 or later, you can use DriveFileUrlBuilder::upload_and_wait or download the file once on the client side and the use UploadFileClientExt::upload_file to upload it.

Source

fn upload_file_from_url_( &self, url: Url, ) -> BoxFuture<'_, Result<DriveFile, Error<Self::Error>>>

Available on non-crate feature 12-48-0 only.

Uploads the file from the given url to the drive.

See upload_file_from_url for the difference between them.

Source

fn build_file_from_url(&self, url: Url) -> DriveFileUrlBuilder<&Self>

Returns a builder for creating a file on the drive.

The returned builder provides methods to customize details of the file, and you can chain them to create a file incrementally. See DriveFileUrlBuilder for the provided methods.

Source

fn delete_file( &self, file: impl EntityRef<DriveFile>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Deletes the specified file on the drive.

Source

fn update_file( &self, file: impl EntityRef<DriveFile>, ) -> DriveFileUpdateBuilder<&Self>

Updates the specified file

This method actually returns a builder, namely DriveFileUpdateBuilder. You can chain the method calls to it corresponding to the fields you want to update. Finally, calling update method will actually perform the update. See DriveFileUpdateBuilder for the fields that can be updated.

Source

fn get_file( &self, id: Id<DriveFile>, ) -> BoxFuture<'_, Result<DriveFile, Error<Self::Error>>>

Gets the corresponding file from the ID.

Source

fn create_folder( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<DriveFolder, Error<Self::Error>>>

Creates a folder on the drive with the given name.

§Examples
let folder = client.create_folder("Folder1").await?;
assert_eq!(folder.name, "Folder1");
Source

fn create_folder_with_parent( &self, name: impl Into<String>, parent: impl EntityRef<DriveFolder>, ) -> BoxFuture<'_, Result<DriveFolder, Error<Self::Error>>>

Creates a folder on the drive with the given name and parent folder.

Source

fn delete_folder( &self, folder: impl EntityRef<DriveFolder>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Deletes the specified folder on the drive.

Source

fn update_folder( &self, folder: impl EntityRef<DriveFolder>, ) -> DriveFolderUpdateBuilder<&Self>

Updates the specified folder.

This method actually returns a builder, namely DriveFolderUpdateBuilder. You can chain the method calls to it corresponding to the fields you want to update. Finally, calling update method will actually perform the update. See DriveFolderUpdateBuilder for the fields that can be updated.

§Examples
let folder = client.create_folder("Folder1").await?;
client
    .update_folder(&folder)
    .name("Folder2")
    .update()
    .await?;
Source

fn get_folder( &self, id: Id<DriveFolder>, ) -> BoxFuture<'_, Result<DriveFolder, Error<Self::Error>>>

Gets the corresponding folder from the ID.

Source

fn attached_notes( &self, file: impl EntityRef<DriveFile>, ) -> BoxFuture<'_, Result<Vec<Note>, Error<Self::Error>>>

Lists the notes that have the specified file attached.

Source

fn find_file_by_name( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<Vec<DriveFile>, Error<Self::Error>>>

Lists the files with the specified name.

Source

fn find_file_by_name_in_folder( &self, name: impl Into<String>, folder: impl EntityRef<DriveFolder>, ) -> BoxFuture<'_, Result<Vec<DriveFile>, Error<Self::Error>>>

Lists the files with the specified name in the folder.

Source

fn find_folder_by_name( &self, name: impl Into<String>, ) -> BoxFuture<'_, Result<Vec<DriveFolder>, Error<Self::Error>>>

Lists the folders with the specified name.

Source

fn find_folder_by_name_in_folder( &self, name: impl Into<String>, folder: impl EntityRef<DriveFolder>, ) -> BoxFuture<'_, Result<Vec<DriveFolder>, Error<Self::Error>>>

Lists the folders with the specified name in the folder.

Source

fn files(&self) -> DriveFileListBuilder<&Self>

Lists the files on the drive.

This method actually returns a builder, namely DriveFileListBuilder. You can specify how you want to list files by chaining methods. The list method of the builder returns a Stream that lists files in the specified way.

§Examples
use futures::stream::TryStreamExt;
use mime::IMAGE_STAR;
use misskey::model::drive::DriveFile;

// Get a list of image files
let images: Vec<DriveFile> = client
    .files()
    .type_(IMAGE_STAR)
    .list()
    .try_collect()
    .await?;
Source

fn folders(&self) -> PagerStream<BoxPager<'_, Self, DriveFolder>>

Lists the folders.

Source

fn folders_in_folder( &self, folder: impl EntityRef<DriveFolder>, ) -> PagerStream<BoxPager<'_, Self, DriveFolder>>

Lists the folders in the folder.

Source

fn add_moderator( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Sets moderator privileges for the specified user.

This operation may require this client to be logged in with an admin account.

Source

fn remove_moderator( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Removes moderator privileges for the specified user.

This operation may require this client to be logged in with an admin account.

Source

fn promote_note( &self, note: impl EntityRef<Note>, expires_at: DateTime<Utc>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Available on crate feature 12-13-0 only.

Promotes the specified note until the time.

This operation may require moderator privileges.

Source

fn abuse_user_reports(&self) -> PagerStream<BoxPager<'_, Self, AbuseUserReport>>

Lists the abuse user reports.

This operation may require moderator privileges.

Source

fn remove_abuse_user_report( &self, report: impl EntityRef<AbuseUserReport>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Available on non-crate feature 12-49-0 only.

Removes the specified abuse user report.

This operation may require moderator privileges.

Source

fn resolve_abuse_user_report( &self, report: impl EntityRef<AbuseUserReport>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Available on crate feature 12-49-0 only.

Marks the specified abuse user report as resolved.

This operation may require moderator privileges.

Source

fn server_logs(&self) -> ServerLogListBuilder<&Self>

Lists the server logs in the instance.

This method actually returns a builder, namely ServerLogListBuilder. You can specify how you want to list users by chaining methods. The list method of the builder fetches the actual logs.

This operation may require moderator privileges.

§Examples
// Get a first 10 entries of 'info' logs with 'chart' domain
let logs = client
    .server_logs()
    .take(10)
    .info()
    .with_domain("chart")
    .list()
    .await?;
Source

fn moderation_logs(&self) -> PagerStream<BoxPager<'_, Self, ModerationLog>>

Lists the moderation logs in the instance.

This operation may require moderator privileges.

Source

fn silence( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Silences the specified user.

This operation may require moderator privileges.

Source

fn suspend( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Suspends the specified user.

This operation may require moderator privileges.

Source

fn unsilence( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Unsilences the specified user.

This operation may require moderator privileges.

Source

fn unsuspend( &self, user: impl EntityRef<User>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Unsuspends the specified user.

This operation may require moderator privileges.

Source

fn update_meta(&self) -> MetaUpdateBuilder<&Self>

Updates the instance information.

This method actually returns a builder, namely MetaUpdateBuilder. You can chain the method calls to it corresponding to the fields you want to update. Finally, calling update method will actually perform the update. See MetaUpdateBuilder for the fields that can be updated.

This operation may require this client to be logged in with an admin account.

§Examples
client
    .update_meta()
    .set_name("The Instance of Saturn")
    .max_note_text_length(5000)
    .update()
    .await?;
Source

fn create_announcement( &self, title: impl Into<String>, text: impl Into<String>, ) -> BoxFuture<'_, Result<Announcement, Error<Self::Error>>>

Creates an announcement with given title and text.

This operation may require moderator privileges.

Source

fn create_announcement_with_image( &self, title: impl Into<String>, text: impl Into<String>, image_url: Url, ) -> BoxFuture<'_, Result<Announcement, Error<Self::Error>>>

Creates an announcement with given title, text, and image URL.

This operation may require moderator privileges.

Source

fn delete_announcement( &self, announcement: impl EntityRef<Announcement>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Deletes the specified announcement.

This operation may require moderator privileges.

Source

fn update_announcement( &self, announcement: Announcement, ) -> AnnouncementUpdateBuilder<&Self>

Updates the specified announcement.

This method actually returns a builder, namely AnnouncementUpdateBuilder. You can chain the method calls to it corresponding to the fields you want to update. Finally, calling update method will actually perform the update. See AnnouncementUpdateBuilder for the fields that can be updated.

This operation may require moderator privileges.

Source

fn create_emoji( &self, file: impl EntityRef<DriveFile>, ) -> BoxFuture<'_, Result<Id<Emoji>, Error<Self::Error>>>

Available on crate feature 12-9-0 only.

Creates a custom emoji from the given file.

This operation may require moderator privileges.

Source

fn delete_emoji( &self, emoji: impl EntityRef<Emoji>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Deletes the specified emoji.

This operation may require moderator privileges.

Source

fn update_emoji(&self, emoji: Emoji) -> EmojiUpdateBuilder<&Self>

Available on crate feature 12-9-0 only.

Updates the specified emoji.

This method actually returns a builder, namely EmojiUpdateBuilder. You can chain the method calls to it corresponding to the fields you want to update. Finally, calling update method will actually perform the update. See EmojiUpdateBuilder for the fields that can be updated.

This operation may require moderator privileges.

Source

fn copy_emoji( &self, emoji: impl EntityRef<Emoji>, ) -> BoxFuture<'_, Result<Id<Emoji>, Error<Self::Error>>>

Copies the specified emoji.

This operation may require moderator privileges.

Source

fn emojis(&self) -> PagerStream<BoxPager<'_, Self, Emoji>>

Lists the emojis in the instance.

This operation may require moderator privileges. Use meta method if you want to get a list of custom emojis from normal users,

Source

fn search_emojis( &self, query: impl Into<String>, ) -> PagerStream<BoxPager<'_, Self, Emoji>>

Searches the emojis using the given query string.

This operation may require moderator privileges.

Source

fn meta(&self) -> BoxFuture<'_, Result<Meta, Error<Self::Error>>>

Gets information about the instance.

Source

fn announcements(&self) -> PagerStream<BoxPager<'_, Self, Announcement>>

Lists announcements of the instance.

Source

fn featured_pages(&self) -> BoxFuture<'_, Result<Vec<Page>, Error<Self::Error>>>

Available on crate feature 12-58-0 only.

Lists the featured pages.

Source

fn user_pages( &self, user: impl EntityRef<User>, ) -> PagerStream<BoxPager<'_, Self, Page>>

Available on crate feature 12-61-0 only.

Lists the pages created by the specified user.

Source

fn mark_all_notifications_as_read( &self, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Marks all notifications as read.

Source

fn create_notification( &self, body: impl Into<String>, ) -> BoxFuture<'_, Result<(), Error<Self::Error>>>

Available on crate feature 12-27-0 only.

Creates a notification with the given text.

Source

fn build_notification(&self) -> NotificationBuilder<&Self>

Available on crate feature 12-27-0 only.

Returns a builder for creating a notification.

The returned builder provides methods to customize details of the notification, and you can chain them to create a notification incrementally. Finally, calling create method will actually create a notification. See NotificationBuilder for the provided methods.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<C: Client + Sync> ClientExt for C