Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

A high level simplex client that implements ClientApi which provides typed client methods with automatic command serialization/response deserialization.

Implementations§

Source§

impl Client

Source

pub fn disconnect(self)

Initiates a graceful shutdown for the underlying web socket connection. See simploxide_core::RawClient::disconnect for details.

Trait Implementations§

Source§

impl ClientApi for Client

Source§

type Error = Arc<Error>

Source§

async fn send_raw(&self, command: String) -> Result<JsonObject, Self::Error>

Source§

fn api_create_my_address( &self, user_id: i64, ) -> impl Future<Output = Result<Arc<ApiCreateMyAddressResponse>, Self::Error>> + Send

Address commands Read more
Source§

fn api_delete_my_address( &self, user_id: i64, ) -> impl Future<Output = Result<Arc<ApiDeleteMyAddressResponse>, Self::Error>> + Send

Address commands Read more
Source§

fn api_show_my_address( &self, user_id: i64, ) -> impl Future<Output = Result<Arc<ApiShowMyAddressResponse>, Self::Error>> + Send

Address commands Read more
Source§

fn api_set_profile_address( &self, command: ApiSetProfileAddress, ) -> impl Future<Output = Result<Arc<ApiSetProfileAddressResponse>, Self::Error>> + Send

Address commands Read more
Source§

fn api_set_address_settings( &self, user_id: i64, settings: AddressSettings, ) -> impl Future<Output = Result<Arc<ApiSetAddressSettingsResponse>, Self::Error>> + Send

Address commands Read more
Source§

fn api_send_messages( &self, command: ApiSendMessages, ) -> impl Future<Output = Result<Arc<ApiSendMessagesResponse>, Self::Error>> + Send

Message commands Read more
Source§

fn api_update_chat_item( &self, command: ApiUpdateChatItem, ) -> impl Future<Output = Result<Arc<ApiUpdateChatItemResponse>, Self::Error>> + Send

Message commands Read more
Source§

fn api_delete_chat_item( &self, chat_ref: ChatRef, chat_item_ids: Vec<i64>, delete_mode: CIDeleteMode, ) -> impl Future<Output = Result<Arc<ApiDeleteChatItemResponse>, Self::Error>> + Send

Message commands Read more
Source§

fn api_delete_member_chat_item( &self, group_id: i64, chat_item_ids: Vec<i64>, ) -> impl Future<Output = Result<Arc<ApiDeleteMemberChatItemResponse>, Self::Error>> + Send

Message commands Read more
Source§

fn api_chat_item_reaction( &self, command: ApiChatItemReaction, ) -> impl Future<Output = Result<Arc<ApiChatItemReactionResponse>, Self::Error>> + Send

Message commands Read more
Source§

fn receive_file( &self, command: ReceiveFile, ) -> impl Future<Output = Result<Arc<ReceiveFileResponse>, Self::Error>> + Send

File commands Read more
Source§

fn cancel_file( &self, file_id: i64, ) -> impl Future<Output = Result<Arc<CancelFileResponse>, Self::Error>> + Send

File commands Read more
Source§

fn api_add_member( &self, group_id: i64, contact_id: i64, member_role: GroupMemberRole, ) -> impl Future<Output = Result<Arc<ApiAddMemberResponse>, Self::Error>> + Send

Group commands Read more
Source§

fn api_join_group( &self, group_id: i64, ) -> impl Future<Output = Result<Arc<ApiJoinGroupResponse>, Self::Error>> + Send

Group commands Read more
Source§

fn api_accept_member( &self, group_id: i64, group_member_id: i64, member_role: GroupMemberRole, ) -> impl Future<Output = Result<Arc<ApiAcceptMemberResponse>, Self::Error>> + Send

Group commands Read more
Source§

fn api_members_role( &self, group_id: i64, group_member_ids: Vec<i64>, member_role: GroupMemberRole, ) -> impl Future<Output = Result<Arc<ApiMembersRoleResponse>, Self::Error>> + Send

Group commands Read more
Source§

fn api_block_members_for_all( &self, command: ApiBlockMembersForAll, ) -> impl Future<Output = Result<Arc<ApiBlockMembersForAllResponse>, Self::Error>> + Send

Group commands Read more
Source§

fn api_remove_members( &self, command: ApiRemoveMembers, ) -> impl Future<Output = Result<Arc<ApiRemoveMembersResponse>, Self::Error>> + Send

Group commands Read more
Source§

fn api_leave_group( &self, group_id: i64, ) -> impl Future<Output = Result<Arc<ApiLeaveGroupResponse>, Self::Error>> + Send

Group commands Read more
Source§

fn api_list_members( &self, group_id: i64, ) -> impl Future<Output = Result<Arc<ApiListMembersResponse>, Self::Error>> + Send

Group commands Read more
Source§

fn api_new_group( &self, command: ApiNewGroup, ) -> impl Future<Output = Result<Arc<ApiNewGroupResponse>, Self::Error>> + Send

Group commands Read more
Source§

fn api_update_group_profile( &self, group_id: i64, group_profile: GroupProfile, ) -> impl Future<Output = Result<Arc<ApiUpdateGroupProfileResponse>, Self::Error>> + Send

Group commands Read more
Group link commands Read more
Group link commands Read more
Group link commands Read more
Group link commands Read more
Source§

fn api_add_contact( &self, command: ApiAddContact, ) -> impl Future<Output = Result<Arc<ApiAddContactResponse>, Self::Error>> + Send

Connection commands Read more
Source§

fn api_connect_plan( &self, command: ApiConnectPlan, ) -> impl Future<Output = Result<Arc<ApiConnectPlanResponse>, Self::Error>> + Send

Connection commands Read more
Source§

fn api_connect( &self, command: ApiConnect, ) -> impl Future<Output = Result<Arc<ApiConnectResponse>, Self::Error>> + Send

Connection commands Read more
Source§

fn connect( &self, command: Connect, ) -> impl Future<Output = Result<Arc<ConnectResponse>, Self::Error>> + Send

Connection commands Read more
Source§

fn api_accept_contact( &self, contact_req_id: i64, ) -> impl Future<Output = Result<Arc<ApiAcceptContactResponse>, Self::Error>> + Send

Connection commands Read more
Source§

fn api_reject_contact( &self, contact_req_id: i64, ) -> impl Future<Output = Result<Arc<ApiRejectContactResponse>, Self::Error>> + Send

Connection commands Read more
Source§

fn api_list_contacts( &self, user_id: i64, ) -> impl Future<Output = Result<Arc<ApiListContactsResponse>, Self::Error>> + Send

Chat commands Read more
Source§

fn api_list_groups( &self, command: ApiListGroups, ) -> impl Future<Output = Result<Arc<ApiListGroupsResponse>, Self::Error>> + Send

Chat commands Read more
Source§

fn api_delete_chat( &self, chat_ref: ChatRef, chat_delete_mode: ChatDeleteMode, ) -> impl Future<Output = Result<Arc<ApiDeleteChatResponse>, Self::Error>> + Send

Chat commands Read more
Source§

fn show_active_user( &self, ) -> impl Future<Output = Result<Arc<ShowActiveUserResponse>, Self::Error>> + Send

User profile commands Read more
Source§

fn create_active_user( &self, new_user: NewUser, ) -> impl Future<Output = Result<Arc<CreateActiveUserResponse>, Self::Error>> + Send

User profile commands Read more
Source§

fn list_users( &self, ) -> impl Future<Output = Result<Arc<ListUsersResponse>, Self::Error>> + Send

User profile commands Read more
Source§

fn api_set_active_user( &self, command: ApiSetActiveUser, ) -> impl Future<Output = Result<Arc<ApiSetActiveUserResponse>, Self::Error>> + Send

User profile commands Read more
Source§

fn api_delete_user( &self, command: ApiDeleteUser, ) -> impl Future<Output = Result<Arc<ApiDeleteUserResponse>, Self::Error>> + Send

User profile commands Read more
Source§

fn api_update_profile( &self, user_id: i64, profile: Profile, ) -> impl Future<Output = Result<Arc<ApiUpdateProfileResponse>, Self::Error>> + Send

User profile commands Read more
Source§

fn api_set_contact_prefs( &self, contact_id: i64, preferences: Preferences, ) -> impl Future<Output = Result<Arc<ApiSetContactPrefsResponse>, Self::Error>> + Send

User profile commands Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl UnwindSafe for Client

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V