[][src]Trait misskey_util::ClientExt

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

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

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

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);

pub fn update_me(&self) -> MeUpdateBuilder<&Self>[src]

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");

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

Follows the specified user.

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

Unfollows the specified user.

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

Mutes the specified user.

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

Unmutes the specified user.

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

Blocks the specified user.

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

Unblocks the specified user.

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

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?;
    }
}

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

Lists the users that the specified user is following.

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

Pins the specified note to the profile.

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

Unpins the specified note to the profile.

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

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?;
}

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

Cancels the follow request being sent to the specified user.

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

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

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

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

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

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

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

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

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

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

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

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);
}

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

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.

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

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);

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

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);

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

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);

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

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);

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

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);

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

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);

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

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);

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

Gets the corresponding user from the ID.

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

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

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

Reports abuse by the specified user.

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

Searches for users with the specified query string.

pub fn users(&self) -> UserListBuilder<&Self>[src]

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?;

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

Lists the recommended users of the instance.

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

Lists the users who frequently reply to the specified user.

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

Lists the users pinned to the instance.

pub fn build_note(&self) -> NoteBuilder<&Self>[src]

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");

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

Deletes the specified note.

Examples

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

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

Gets the corresponding note from the ID.

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

Creates a note with the given text.

Examples

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

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

Creates a poll with the given text and choices.

Examples

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

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

Creates a reply note with the given text.

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

Creates a renote.

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

Creates a quote note with the given text.

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

Adds the reaction to the specified note.

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

Deletes a reaction from the specified note.

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

Favorites the specified note.

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

Unfavorites the specified note.

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

Watches the specified note.

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

Unwatches the specified note.

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

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

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

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

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

Vote on the specified note.

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

Lists the featured notes.

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

Lists the notes of the conversation.

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

Lists the reply notes to the specified note.

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

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

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

Lists the renotes of the specified note.

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

Lists the replies to the specified note.

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

Searches for notes with the specified query string.

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

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..);

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

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);
    }
}

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

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

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

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..);

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

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);
    }
}

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

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

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

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..);

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

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);
    }
}

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

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

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

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..);

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

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);
    }
}

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

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

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

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..);

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

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);
    }
}

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

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

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

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..);

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

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);
    }
}

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

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

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

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..);

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

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);
    }
}

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

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

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

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"));

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

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]);

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

Creates a user list with the given name.

Examples

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

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

Deletes the specified user list.

Examples

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

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

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");

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

Gets the corresponding user list from the ID.

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

Adds the user from the specified user list.

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

Deletes the user from the specified user list.

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

Creates a user group with the given name.

Examples

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

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

Deletes the specified user group.

Examples

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

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

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");

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

Gets the corresponding user group from the ID.

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

Invites the user to the specified user group.

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

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.

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

Transfers the specified user group.

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

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

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?;
}

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

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

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

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

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

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

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

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

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

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");

pub fn build_antenna(&self) -> AntennaBuilder<&Self>[src]

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");

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

Deletes the specified antenna.

Examples

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

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

Gets the corresponding antenna from the ID.

pub fn update_antenna(&self, antenna: Antenna) -> AntennaUpdateBuilder<&Self>[src]

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?;

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

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

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

Lists the notes that hit the specified antenna.

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

This is supported 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");

pub fn build_channel(&self) -> ChannelBuilder<&Self>[src]

This is supported 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");

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

This is supported on crate feature 12-47-0 only.

Gets the corresponding channel from the ID.

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

This is supported 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?;

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

This is supported on crate feature 12-47-0 only.

Follows the specified channel.

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

This is supported on crate feature 12-47-0 only.

Unfollows the specified channel.

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

This is supported on crate feature 12-48-0 only.

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

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

This is supported on crate feature 12-48-0 only.

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

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

This is supported on crate feature 12-47-0 only.

Lists the featured channels.

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

Creates a clip with the given name.

Examples

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

pub fn build_clip(&self) -> ClipBuilder<&Self>[src]

This is supported 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");

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

Deletes the specified clip.

Examples

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

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

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

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

This is supported on crate feature 12-58-0 only.

Lists the clips that contain the specified note.

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

This is supported on crate feature 12-57-0 only.

Clips the specified note.

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

Lists the notes that are clipped to the specified clip.

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

Gets the corresponding clip from the ID.

pub fn update_clip(&self, clip: Clip) -> ClipUpdateBuilder<&Self>[src]

This is supported 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?;

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

This is supported on crate feature 12-61-0 only.

Lists the clips created by the specified user.

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

Sends a message to the user with the given text.

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

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

pub fn build_message(&self) -> MessagingMessageBuilder<&Self>[src]

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.

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

Deletes the specified message.

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

Marks the specified message as read.

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

Lists the messages with the specified user.

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

Lists the messages in the specified user group.

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

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

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

This is supported 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.

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

This is supported 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.

pub fn build_file_from_url(&self, url: Url) -> DriveFileUrlBuilder<&Self>[src]

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.

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

Deletes the specified file on the drive.

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

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.

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

Gets the corresponding file from the ID.

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

Creates a folder on the drive with the given name.

Examples

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

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

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

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

Deletes the specified folder on the drive.

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

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?;

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

Gets the corresponding folder from the ID.

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

Lists the notes that have the specified file attached.

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

Lists the files with the specified name.

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

Lists the files with the specified name in the folder.

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

Lists the folders with the specified name.

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

Lists the folders with the specified name in the folder.

pub fn files(&self) -> DriveFileListBuilder<&Self>[src]

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?;

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

Lists the folders.

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

Lists the folders in the folder.

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

Sets moderator privileges for the specified user.

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

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

Removes moderator privileges for the specified user.

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

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

This is supported on crate feature 12-13-0 only.

Promotes the specified note until the time.

This operation may require moderator privileges.

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

Lists the abuse user reports.

This operation may require moderator privileges.

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

This is supported on non-crate feature 12-49-0 only.

Removes the specified abuse user report.

This operation may require moderator privileges.

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

This is supported on crate feature 12-49-0 only.

Marks the specified abuse user report as resolved.

This operation may require moderator privileges.

pub fn server_logs(&self) -> ServerLogListBuilder<&Self>[src]

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?;

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

Lists the moderation logs in the instance.

This operation may require moderator privileges.

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

Silences the specified user.

This operation may require moderator privileges.

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

Suspends the specified user.

This operation may require moderator privileges.

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

Unsilences the specified user.

This operation may require moderator privileges.

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

Unsuspends the specified user.

This operation may require moderator privileges.

pub fn update_meta(&self) -> MetaUpdateBuilder<&Self>[src]

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?;

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

Creates an announcement with given title and text.

This operation may require moderator privileges.

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

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

This operation may require moderator privileges.

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

Deletes the specified announcement.

This operation may require moderator privileges.

pub fn update_announcement(
    &self,
    announcement: Announcement
) -> AnnouncementUpdateBuilder<&Self>
[src]

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.

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

This is supported on crate feature 12-9-0 only.

Creates a custom emoji from the given file.

This operation may require moderator privileges.

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

Deletes the specified emoji.

This operation may require moderator privileges.

pub fn update_emoji(&self, emoji: Emoji) -> EmojiUpdateBuilder<&Self>[src]

This is supported 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.

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

Copies the specified emoji.

This operation may require moderator privileges.

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

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,

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

Searches the emojis using the given query string.

This operation may require moderator privileges.

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

Gets information about the instance.

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

Lists announcements of the instance.

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

This is supported on crate feature 12-58-0 only.

Lists the featured pages.

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

This is supported on crate feature 12-61-0 only.

Lists the pages created by the specified user.

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

Marks all notifications as read.

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

This is supported on crate feature 12-27-0 only.

Creates a notification with the given text.

pub fn build_notification(&self) -> NotificationBuilder<&Self>[src]

This is supported 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.

Loading content...

Implementors

impl<C: Client + Sync> ClientExt for C[src]

Loading content...