pub struct MessageService { /* private fields */ }Expand description
Unified message and synchronization service
Implementations§
Source§impl MessageService
impl MessageService
Sourcepub async fn send_message(
&self,
entity_id: String,
entity_type: EntityType,
content: MessageContent,
reply_to_id: Option<String>,
) -> MessageServiceResult<CRDTMessage>
pub async fn send_message( &self, entity_id: String, entity_type: EntityType, content: MessageContent, reply_to_id: Option<String>, ) -> MessageServiceResult<CRDTMessage>
Send a message to an entity
Sourcepub async fn receive_message(
&self,
message: CRDTMessage,
) -> MessageServiceResult<ReceiveResult>
pub async fn receive_message( &self, message: CRDTMessage, ) -> MessageServiceResult<ReceiveResult>
Receive and process an incoming message
Sourcepub async fn get_entity_messages(
&self,
entity_id: String,
) -> MessageServiceResult<SyncResponse>
pub async fn get_entity_messages( &self, entity_id: String, ) -> MessageServiceResult<SyncResponse>
Get all messages for an entity
Sourcepub async fn get_thread_messages(
&self,
entity_id: String,
parent_message_id: String,
) -> MessageServiceResult<Vec<CRDTMessage>>
pub async fn get_thread_messages( &self, entity_id: String, parent_message_id: String, ) -> MessageServiceResult<Vec<CRDTMessage>>
Get messages for a specific thread (all replies to a parent message)
Sourcepub async fn get_entity_sync_state(
&self,
entity_id: String,
entity_type: EntityType,
) -> MessageServiceResult<EntitySyncState>
pub async fn get_entity_sync_state( &self, entity_id: String, entity_type: EntityType, ) -> MessageServiceResult<EntitySyncState>
Get sync state for an entity (simplified implementation)
Sourcepub async fn send_direct_messages(
&self,
recipients: Vec<String>,
content: MessageContent,
) -> MessageServiceResult<Vec<String>>
pub async fn send_direct_messages( &self, recipients: Vec<String>, content: MessageContent, ) -> MessageServiceResult<Vec<String>>
Send a direct message to specific recipients
Sourcepub async fn get_direct_messages(
&self,
other_peer_id: String,
) -> MessageServiceResult<SyncResponse>
pub async fn get_direct_messages( &self, other_peer_id: String, ) -> MessageServiceResult<SyncResponse>
Get direct messages between current user and another peer
Sourcepub async fn send_to_channel(
&self,
channel_id: String,
content: MessageContent,
) -> MessageServiceResult<String>
pub async fn send_to_channel( &self, channel_id: String, content: MessageContent, ) -> MessageServiceResult<String>
Send message to channel (compatibility method)
Sourcepub async fn send_thread_reply(
&self,
entity_id: String,
entity_type: EntityType,
thread_id: String,
content: MessageContent,
) -> MessageServiceResult<String>
pub async fn send_thread_reply( &self, entity_id: String, entity_type: EntityType, thread_id: String, content: MessageContent, ) -> MessageServiceResult<String>
Send thread reply (compatibility method)
Sourcepub async fn get_channel_messages(
&self,
channel_id: String,
) -> MessageServiceResult<Vec<CRDTMessage>>
pub async fn get_channel_messages( &self, channel_id: String, ) -> MessageServiceResult<Vec<CRDTMessage>>
Get channel messages (compatibility method)
Sourcepub fn sort_messages(&self, messages: &mut [CRDTMessage])
pub fn sort_messages(&self, messages: &mut [CRDTMessage])
Sort messages causally (utility method)
pub async fn delete_message( &self, entity_id: &str, message_id: &str, ) -> MessageServiceResult<bool>
pub async fn edit_message( &self, entity_id: &str, message_id: &str, new_text: String, ) -> MessageServiceResult<u64>
pub async fn add_reaction( &self, entity_id: &str, message_id: &str, emoji: String, peer_id: String, ) -> MessageServiceResult<()>
pub async fn remove_reaction( &self, entity_id: &str, message_id: &str, emoji: String, peer_id: String, ) -> MessageServiceResult<()>
pub async fn get_reactions( &self, entity_id: &str, message_id: &str, ) -> MessageServiceResult<Vec<Reaction>>
Auto Trait Implementations§
impl Freeze for MessageService
impl !RefUnwindSafe for MessageService
impl Send for MessageService
impl Sync for MessageService
impl Unpin for MessageService
impl !UnwindSafe for MessageService
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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