pub struct WsClient { /* private fields */ }Implementations§
Source§impl WsClient
impl WsClient
pub fn with_service(service: Box<dyn WebSocketService>) -> Self
pub async fn start_service(&self) -> Result<()>
pub fn change_service(&mut self, service: Box<dyn WebSocketService>)
pub fn get_service(&self) -> &dyn WebSocketService
pub fn get_service_mut(&mut self) -> &mut dyn WebSocketService
Trait Implementations§
Source§impl APISender for WsClient
impl APISender for WsClient
fn send_private_msg<'life0, 'async_trait>(
&'life0 self,
user_id: i64,
message: Vec<SendSegment>,
auto_escape: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<i32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_group_msg<'life0, 'async_trait>(
&'life0 self,
group_id: i64,
message: Vec<SendSegment>,
auto_escape: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<i32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_msg<'life0, 'async_trait>(
&'life0 self,
message_type: Option<MessageType>,
user_id: i64,
group_id: i64,
message: Vec<SendSegment>,
auto_escape: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<i32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_msg<'life0, 'async_trait>(
&'life0 self,
message_id: i32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_msg<'life0, 'async_trait>(
&'life0 self,
message_id: i32,
) -> Pin<Box<dyn Future<Output = Result<GetMsgResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_forward_msg<'life0, 'async_trait>(
&'life0 self,
id: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<ReceiveSegment>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_like<'life0, 'async_trait>(
&'life0 self,
user_id: i64,
times: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_group_kick<'life0, 'async_trait>(
&'life0 self,
group_id: i32,
user_id: i32,
reject_add_request: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_group_ban<'life0, 'async_trait>(
&'life0 self,
group_id: i32,
user_id: i32,
duration: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_group_anonymous_ban<'life0, 'async_trait>(
&'life0 self,
group_id: i32,
anonymous: Option<GroupMessageAnonymous>,
flag: Option<String>,
duration: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_group_whole_ban<'life0, 'async_trait>(
&'life0 self,
group_id: i32,
enable: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_group_admin<'life0, 'async_trait>(
&'life0 self,
group_id: i32,
user_id: i32,
enable: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_group_anonymous<'life0, 'async_trait>(
&'life0 self,
group_id: i32,
enable: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_group_card<'life0, 'async_trait>(
&'life0 self,
group_id: i32,
user_id: i32,
card: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_group_name<'life0, 'async_trait>(
&'life0 self,
group_id: i32,
group_name: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_group_leave<'life0, 'async_trait>(
&'life0 self,
group_id: i32,
is_dismiss: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_group_special_title<'life0, 'async_trait>(
&'life0 self,
group_id: i32,
user_id: i32,
special_title: Option<String>,
duration: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_friend_add_request<'life0, 'async_trait>(
&'life0 self,
flag: String,
approve: Option<bool>,
remark: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_group_add_request<'life0, 'async_trait>(
&'life0 self,
flag: String,
sub_type: String,
approve: Option<bool>,
reason: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_login_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GetLoginInfoResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_stranger_info<'life0, 'async_trait>(
&'life0 self,
user_id: i32,
no_cache: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<GetStrangerInfoResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_friend_list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<GetFriendListResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_group_info<'life0, 'async_trait>(
&'life0 self,
group_id: i32,
no_cache: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<GetGroupInfoResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_group_list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<GetGroupInfoResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_group_member_info<'life0, 'async_trait>(
&'life0 self,
group_id: i32,
user_id: i32,
no_cache: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<GetGroupMemberInfoResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_group_member_list<'life0, 'async_trait>(
&'life0 self,
group_id: i32,
) -> Pin<Box<dyn Future<Output = Result<Vec<GetGroupMemberInfoResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_group_honor_info<'life0, 'async_trait>(
&'life0 self,
group_id: i64,
honor_type: String,
) -> Pin<Box<dyn Future<Output = Result<GetGroupMemberInfoResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_csrf_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<i32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_credentials<'life0, 'async_trait>(
&'life0 self,
domain: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<GetCredentialsResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_record<'life0, 'async_trait>(
&'life0 self,
file: String,
out_format: String,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_image<'life0, 'async_trait>(
&'life0 self,
file: String,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn can_send_image<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn can_send_record<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GetStatusResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_version_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GetVersionInfoResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_restart<'life0, 'async_trait>(
&'life0 self,
delay: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clean_cache<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for WsClient
impl !RefUnwindSafe for WsClient
impl Send for WsClient
impl Sync for WsClient
impl Unpin for WsClient
impl !UnwindSafe for WsClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more