pub trait ClientApiExt: ClientApi {
Show 44 methods
// Required methods
fn users(&self) -> impl Future<Output = UsersResponse<Self>>;
fn contacts<UID: Into<UserId>>(
&self,
user_id: UID,
) -> impl Future<Output = ContactsResponse<Self>>;
fn groups<UID: Into<UserId>>(
&self,
user_id: UID,
) -> impl Future<Output = GroupsResponse<Self>>;
fn accept_contact<CRID: Into<ContactRequestId>>(
&self,
contact_request_id: CRID,
) -> impl Future<Output = AcceptContactResponse<Self>>;
fn reject_contact<CRID: Into<ContactRequestId>>(
&self,
contact_request_id: CRID,
) -> impl Future<Output = RejectContactResponse<Self>>;
fn new_user(
&self,
user: NewUser,
) -> impl Future<Output = NewUserResponse<Self>>;
fn send_message<CID: Into<ChatId>, M: MessageLike>(
&self,
chat_id: CID,
msg: M,
) -> MessageBuilder<'_, Self, M::Kind>;
fn multicast_message<I, M>(
&self,
chat_ids: I,
msg: M,
) -> MulticastBuilder<'_, I, Self, M::Kind>
where I: IntoIterator<Item = ChatId>,
M: MessageLike;
fn update_message<CID: Into<ChatId>, MID: Into<MessageId>>(
&self,
chat_id: CID,
message_id: MID,
new_content: MsgContent,
) -> impl Future<Output = UpdateMessageResponse<Self>>;
fn batch_delete_messages<CID: Into<ChatId>, I: IntoIterator<Item = MessageId>>(
&self,
chat_id: CID,
message_ids: I,
mode: CIDeleteMode,
) -> impl Future<Output = DeleteMessageResponse<Self>>;
fn batch_message_reactions<CID: Into<ChatId>, MID: Into<MessageId>, I: IntoIterator<Item = Reaction>>(
&self,
chat_id: CID,
message_id: MID,
reactions: I,
) -> impl Future<Output = UpdateMessageReactionsResponse<Self>>;
fn accept_file<FID: Into<FileId>>(
&self,
file_id: FID,
) -> AcceptFileBuilder<'_, Self>;
fn reject_file<FID: Into<FileId>>(
&self,
file_id: FID,
) -> impl Future<Output = RejectFileResponse<Self>>;
fn initiate_connection(
&self,
link: impl Into<String>,
) -> impl Future<Output = InitiateConnectionResponse<Self>>;
fn delete_chat<CID: Into<ChatId>>(
&self,
chat_id: CID,
mode: DeleteMode,
) -> impl Future<Output = DeleteChatResponse<Self>>;
fn add_member<GID: Into<GroupId>, CID: Into<ContactId>>(
&self,
group_id: GID,
contact_id: CID,
role: GroupMemberRole,
) -> impl Future<Output = AddMemberResponse<Self>>;
fn join_group<GID: Into<GroupId>>(
&self,
group_id: GID,
) -> impl Future<Output = JoinGroupResponse<Self>>;
fn accept_member<GID: Into<GroupId>, MID: Into<MemberId>>(
&self,
group_id: GID,
member_id: MID,
role: GroupMemberRole,
) -> impl Future<Output = AcceptMemberResponse<Self>>;
fn set_members_role<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>(
&self,
group_id: GID,
member_ids: I,
role: GroupMemberRole,
) -> impl Future<Output = SetMembersRoleResponse<Self>>;
fn block_members_for_all<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>(
&self,
group_id: GID,
member_ids: I,
) -> impl Future<Output = BlockMembersResponse<Self>>;
fn unblock_members_for_all<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>(
&self,
group_id: GID,
member_ids: I,
) -> impl Future<Output = BlockMembersResponse<Self>>;
fn remove_members<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>(
&self,
group_id: GID,
member_ids: I,
) -> impl Future<Output = RemoveMembersResponse<Self>>;
fn remove_members_with_messages<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>(
&self,
group_id: GID,
member_ids: I,
) -> impl Future<Output = RemoveMembersResponse<Self>>;
fn leave_group<GID: Into<GroupId>>(
&self,
group_id: GID,
) -> impl Future<Output = LeaveGroupResponse<Self>>;
fn list_members<GID: Into<GroupId>>(
&self,
group_id: GID,
) -> impl Future<Output = ListMembersResponse<Self>>;
fn moderate_messages<GID: Into<GroupId>, I: IntoIterator<Item = MessageId>>(
&self,
group_id: GID,
message_ids: I,
) -> impl Future<Output = DeleteMessageResponse<Self>>;
fn update_group_profile<GID: Into<GroupId>>(
&self,
group_id: GID,
profile: GroupProfile,
) -> impl Future<Output = UpdateGroupProfileResponse<Self>>;
fn set_group_custom_data<GID: Into<GroupId>>(
&self,
group_id: GID,
data: Option<JsonObject>,
) -> impl Future<Output = SetGroupCustomDataResponse<Self>>;
fn set_contact_custom_data<CID: Into<ContactId>>(
&self,
contact_id: CID,
data: Option<JsonObject>,
) -> impl Future<Output = SetContactCustomDataResponse<Self>>;
fn create_group_link<GID: Into<GroupId>>(
&self,
group_id: GID,
role: GroupMemberRole,
) -> impl Future<Output = CreateGroupLinkResult<Self>>;
fn set_group_link_role<GID: Into<GroupId>>(
&self,
group_id: GID,
role: GroupMemberRole,
) -> impl Future<Output = GroupLinkResult<Self>>;
fn delete_group_link<GID: Into<GroupId>>(
&self,
group_id: GID,
) -> impl Future<Output = DeleteGroupLinkResult<Self>>;
fn get_group_link<GID: Into<GroupId>>(
&self,
group_id: GID,
) -> impl Future<Output = GroupLinkResult<Self>>;
fn get_group_relays<GID: Into<GroupId>>(
&self,
group_id: GID,
) -> impl Future<Output = GetGroupRelaysResponse<Self>>;
fn add_group_relays<GID: Into<GroupId>, I: IntoIterator<Item = RelayId>>(
&self,
group_id: GID,
relay_ids: I,
) -> impl Future<Output = AddGroupRelaysResponse<Self>>;
// Provided methods
fn delete_message<CID: Into<ChatId>, MID: Into<MessageId>>(
&self,
chat_id: CID,
message_id: MID,
mode: CIDeleteMode,
) -> impl Future<Output = DeleteMessageResponse<Self>> { ... }
fn update_message_reaction<CID: Into<ChatId>, MID: Into<MessageId>>(
&self,
chat_id: CID,
message_id: MID,
reaction: Reaction,
) -> impl Future<Output = UpdateMessageReactionsResponse<Self>> { ... }
fn set_member_role<GID: Into<GroupId>, MID: Into<MemberId>>(
&self,
group_id: GID,
member_id: MID,
role: GroupMemberRole,
) -> impl Future<Output = SetMembersRoleResponse<Self>> { ... }
fn block_member_for_all<GID: Into<GroupId>, MID: Into<MemberId>>(
&self,
group_id: GID,
member_id: MID,
) -> impl Future<Output = BlockMembersResponse<Self>> { ... }
fn unblock_member_for_all<GID: Into<GroupId>, MID: Into<MemberId>>(
&self,
group_id: GID,
member_id: MID,
) -> impl Future<Output = BlockMembersResponse<Self>> { ... }
fn remove_member<GID: Into<GroupId>, MID: Into<MemberId>>(
&self,
group_id: GID,
member_id: MID,
) -> impl Future<Output = RemoveMembersResponse<Self>> { ... }
fn remove_member_with_messages<GID: Into<GroupId>, MID: Into<MemberId>>(
&self,
group_id: GID,
member_id: MID,
) -> impl Future<Output = RemoveMembersResponse<Self>> { ... }
fn moderate_message<GID: Into<GroupId>, MID: Into<MessageId>>(
&self,
group_id: GID,
message_id: MID,
) -> impl Future<Output = DeleteMessageResponse<Self>> { ... }
fn add_group_relay<GID: Into<GroupId>, RID: Into<RelayId>>(
&self,
group_id: GID,
relay_id: RID,
) -> impl Future<Output = AddGroupRelaysResponse<Self>> { ... }
}Required Methods§
fn users(&self) -> impl Future<Output = UsersResponse<Self>>
fn contacts<UID: Into<UserId>>( &self, user_id: UID, ) -> impl Future<Output = ContactsResponse<Self>>
fn groups<UID: Into<UserId>>( &self, user_id: UID, ) -> impl Future<Output = GroupsResponse<Self>>
fn accept_contact<CRID: Into<ContactRequestId>>( &self, contact_request_id: CRID, ) -> impl Future<Output = AcceptContactResponse<Self>>
fn reject_contact<CRID: Into<ContactRequestId>>( &self, contact_request_id: CRID, ) -> impl Future<Output = RejectContactResponse<Self>>
Sourcefn new_user(&self, user: NewUser) -> impl Future<Output = NewUserResponse<Self>>
fn new_user(&self, user: NewUser) -> impl Future<Output = NewUserResponse<Self>>
Like ClientApi::create_active_user but ensures that user is created even if the name contains disallowed in SimpleX-Chat UTF-8 characters. The NewUser struct gets cloned when performing the original request
Sourcefn send_message<CID: Into<ChatId>, M: MessageLike>(
&self,
chat_id: CID,
msg: M,
) -> MessageBuilder<'_, Self, M::Kind>
fn send_message<CID: Into<ChatId>, M: MessageLike>( &self, chat_id: CID, msg: M, ) -> MessageBuilder<'_, Self, M::Kind>
Returns a powerful awaitable MessageBuilder type. Check its docs to learn how to build any message kind ergonomically
Sourcefn multicast_message<I, M>(
&self,
chat_ids: I,
msg: M,
) -> MulticastBuilder<'_, I, Self, M::Kind>
fn multicast_message<I, M>( &self, chat_ids: I, msg: M, ) -> MulticastBuilder<'_, I, Self, M::Kind>
Deliver the same message to multiple recepients
fn update_message<CID: Into<ChatId>, MID: Into<MessageId>>( &self, chat_id: CID, message_id: MID, new_content: MsgContent, ) -> impl Future<Output = UpdateMessageResponse<Self>>
fn batch_delete_messages<CID: Into<ChatId>, I: IntoIterator<Item = MessageId>>( &self, chat_id: CID, message_ids: I, mode: CIDeleteMode, ) -> impl Future<Output = DeleteMessageResponse<Self>>
fn batch_message_reactions<CID: Into<ChatId>, MID: Into<MessageId>, I: IntoIterator<Item = Reaction>>( &self, chat_id: CID, message_id: MID, reactions: I, ) -> impl Future<Output = UpdateMessageReactionsResponse<Self>>
fn accept_file<FID: Into<FileId>>( &self, file_id: FID, ) -> AcceptFileBuilder<'_, Self>
fn reject_file<FID: Into<FileId>>( &self, file_id: FID, ) -> impl Future<Output = RejectFileResponse<Self>>
fn initiate_connection( &self, link: impl Into<String>, ) -> impl Future<Output = InitiateConnectionResponse<Self>>
fn delete_chat<CID: Into<ChatId>>( &self, chat_id: CID, mode: DeleteMode, ) -> impl Future<Output = DeleteChatResponse<Self>>
fn add_member<GID: Into<GroupId>, CID: Into<ContactId>>( &self, group_id: GID, contact_id: CID, role: GroupMemberRole, ) -> impl Future<Output = AddMemberResponse<Self>>
fn join_group<GID: Into<GroupId>>( &self, group_id: GID, ) -> impl Future<Output = JoinGroupResponse<Self>>
fn accept_member<GID: Into<GroupId>, MID: Into<MemberId>>( &self, group_id: GID, member_id: MID, role: GroupMemberRole, ) -> impl Future<Output = AcceptMemberResponse<Self>>
fn set_members_role<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>( &self, group_id: GID, member_ids: I, role: GroupMemberRole, ) -> impl Future<Output = SetMembersRoleResponse<Self>>
fn block_members_for_all<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>( &self, group_id: GID, member_ids: I, ) -> impl Future<Output = BlockMembersResponse<Self>>
fn unblock_members_for_all<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>( &self, group_id: GID, member_ids: I, ) -> impl Future<Output = BlockMembersResponse<Self>>
fn remove_members<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>( &self, group_id: GID, member_ids: I, ) -> impl Future<Output = RemoveMembersResponse<Self>>
fn remove_members_with_messages<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>( &self, group_id: GID, member_ids: I, ) -> impl Future<Output = RemoveMembersResponse<Self>>
fn leave_group<GID: Into<GroupId>>( &self, group_id: GID, ) -> impl Future<Output = LeaveGroupResponse<Self>>
fn list_members<GID: Into<GroupId>>( &self, group_id: GID, ) -> impl Future<Output = ListMembersResponse<Self>>
fn moderate_messages<GID: Into<GroupId>, I: IntoIterator<Item = MessageId>>( &self, group_id: GID, message_ids: I, ) -> impl Future<Output = DeleteMessageResponse<Self>>
fn update_group_profile<GID: Into<GroupId>>( &self, group_id: GID, profile: GroupProfile, ) -> impl Future<Output = UpdateGroupProfileResponse<Self>>
fn set_group_custom_data<GID: Into<GroupId>>( &self, group_id: GID, data: Option<JsonObject>, ) -> impl Future<Output = SetGroupCustomDataResponse<Self>>
fn set_contact_custom_data<CID: Into<ContactId>>( &self, contact_id: CID, data: Option<JsonObject>, ) -> impl Future<Output = SetContactCustomDataResponse<Self>>
fn create_group_link<GID: Into<GroupId>>( &self, group_id: GID, role: GroupMemberRole, ) -> impl Future<Output = CreateGroupLinkResult<Self>>
fn set_group_link_role<GID: Into<GroupId>>( &self, group_id: GID, role: GroupMemberRole, ) -> impl Future<Output = GroupLinkResult<Self>>
fn delete_group_link<GID: Into<GroupId>>( &self, group_id: GID, ) -> impl Future<Output = DeleteGroupLinkResult<Self>>
fn get_group_link<GID: Into<GroupId>>( &self, group_id: GID, ) -> impl Future<Output = GroupLinkResult<Self>>
fn get_group_relays<GID: Into<GroupId>>( &self, group_id: GID, ) -> impl Future<Output = GetGroupRelaysResponse<Self>>
fn add_group_relays<GID: Into<GroupId>, I: IntoIterator<Item = RelayId>>( &self, group_id: GID, relay_ids: I, ) -> impl Future<Output = AddGroupRelaysResponse<Self>>
Provided Methods§
fn delete_message<CID: Into<ChatId>, MID: Into<MessageId>>( &self, chat_id: CID, message_id: MID, mode: CIDeleteMode, ) -> impl Future<Output = DeleteMessageResponse<Self>>
fn update_message_reaction<CID: Into<ChatId>, MID: Into<MessageId>>( &self, chat_id: CID, message_id: MID, reaction: Reaction, ) -> impl Future<Output = UpdateMessageReactionsResponse<Self>>
fn set_member_role<GID: Into<GroupId>, MID: Into<MemberId>>( &self, group_id: GID, member_id: MID, role: GroupMemberRole, ) -> impl Future<Output = SetMembersRoleResponse<Self>>
fn block_member_for_all<GID: Into<GroupId>, MID: Into<MemberId>>( &self, group_id: GID, member_id: MID, ) -> impl Future<Output = BlockMembersResponse<Self>>
fn unblock_member_for_all<GID: Into<GroupId>, MID: Into<MemberId>>( &self, group_id: GID, member_id: MID, ) -> impl Future<Output = BlockMembersResponse<Self>>
fn remove_member<GID: Into<GroupId>, MID: Into<MemberId>>( &self, group_id: GID, member_id: MID, ) -> impl Future<Output = RemoveMembersResponse<Self>>
fn remove_member_with_messages<GID: Into<GroupId>, MID: Into<MemberId>>( &self, group_id: GID, member_id: MID, ) -> impl Future<Output = RemoveMembersResponse<Self>>
fn moderate_message<GID: Into<GroupId>, MID: Into<MessageId>>( &self, group_id: GID, message_id: MID, ) -> impl Future<Output = DeleteMessageResponse<Self>>
fn add_group_relay<GID: Into<GroupId>, RID: Into<RelayId>>( &self, group_id: GID, relay_id: RID, ) -> impl Future<Output = AddGroupRelaysResponse<Self>>
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.