pub struct MessageService { /* private fields */ }Expand description
消息服务
Implementations§
Source§impl MessageService
impl MessageService
Sourcepub fn new(http: Arc<HttpClient>) -> Self
pub fn new(http: Arc<HttpClient>) -> Self
创建新的消息服务
Sourcepub fn with_mqtt(http: Arc<HttpClient>, mqtt: Arc<RwLock<MqttClient>>) -> Self
pub fn with_mqtt(http: Arc<HttpClient>, mqtt: Arc<RwLock<MqttClient>>) -> Self
使用 MQTT 客户端创建消息服务
Sourcepub async fn get_conversation_messages(
&self,
conversation_id: &str,
cursor: Option<&str>,
limit: Option<i32>,
) -> SdkResult<MessagesResponse>
pub async fn get_conversation_messages( &self, conversation_id: &str, cursor: Option<&str>, limit: Option<i32>, ) -> SdkResult<MessagesResponse>
Sourcepub async fn send_message(
&self,
conversation_id: &str,
content: &str,
message_type: Option<&str>,
reply_to_id: Option<&str>,
data: Option<Value>,
) -> SdkResult<Message>
pub async fn send_message( &self, conversation_id: &str, content: &str, message_type: Option<&str>, reply_to_id: Option<&str>, data: Option<Value>, ) -> SdkResult<Message>
Sourcepub async fn delete_message(
&self,
conversation_id: &str,
message_id: &str,
) -> SdkResult<()>
pub async fn delete_message( &self, conversation_id: &str, message_id: &str, ) -> SdkResult<()>
Sourcepub async fn mark_message_as_read(
&self,
conversation_id: &str,
message_id: &str,
) -> SdkResult<()>
pub async fn mark_message_as_read( &self, conversation_id: &str, message_id: &str, ) -> SdkResult<()>
Auto Trait Implementations§
impl Freeze for MessageService
impl !RefUnwindSafe for MessageService
impl Send for MessageService
impl Sync for MessageService
impl Unpin for MessageService
impl UnsafeUnpin for MessageService
impl !UnwindSafe for MessageService
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