pub struct MessageHistory { /* private fields */ }Expand description
Message history storage and retrieval
Implementations§
Source§impl MessageHistory
impl MessageHistory
pub fn new(connection: Arc<Mutex<Connection>>) -> Self
Sourcepub fn store_incoming_message(
&self,
rdx_fingerprint: &str,
timestamp: u64,
plaintext: &[u8],
was_prekey_message: bool,
session_established: bool,
) -> Result<i64, MessageHistoryError>
pub fn store_incoming_message( &self, rdx_fingerprint: &str, timestamp: u64, plaintext: &[u8], was_prekey_message: bool, session_established: bool, ) -> Result<i64, MessageHistoryError>
Store an incoming message
Sourcepub fn store_outgoing_message(
&self,
rdx_fingerprint: &str,
timestamp: u64,
plaintext: &[u8],
) -> Result<i64, MessageHistoryError>
pub fn store_outgoing_message( &self, rdx_fingerprint: &str, timestamp: u64, plaintext: &[u8], ) -> Result<i64, MessageHistoryError>
Store an outgoing message
Sourcepub fn update_delivery_status(
&self,
message_id: i64,
status: DeliveryStatus,
) -> Result<(), MessageHistoryError>
pub fn update_delivery_status( &self, message_id: i64, status: DeliveryStatus, ) -> Result<(), MessageHistoryError>
Update message delivery status
Sourcepub fn get_message(
&self,
message_id: i64,
) -> Result<StoredMessage, MessageHistoryError>
pub fn get_message( &self, message_id: i64, ) -> Result<StoredMessage, MessageHistoryError>
Retrieve message by ID
Sourcepub fn get_conversation_messages(
&self,
rdx_fingerprint: &str,
limit: u32,
offset: u32,
) -> Result<Vec<StoredMessage>, MessageHistoryError>
pub fn get_conversation_messages( &self, rdx_fingerprint: &str, limit: u32, offset: u32, ) -> Result<Vec<StoredMessage>, MessageHistoryError>
Get messages for a conversation (paginated, newest first)
Sourcepub fn get_conversations(
&self,
include_archived: bool,
) -> Result<Vec<Conversation>, MessageHistoryError>
pub fn get_conversations( &self, include_archived: bool, ) -> Result<Vec<Conversation>, MessageHistoryError>
Get all conversations ordered by recent activity
Sourcepub fn get_unread_count(
&self,
rdx_fingerprint: &str,
) -> Result<u32, MessageHistoryError>
pub fn get_unread_count( &self, rdx_fingerprint: &str, ) -> Result<u32, MessageHistoryError>
Get unread message count for a conversation
Sourcepub fn mark_conversation_read(
&self,
rdx_fingerprint: &str,
) -> Result<(), MessageHistoryError>
pub fn mark_conversation_read( &self, rdx_fingerprint: &str, ) -> Result<(), MessageHistoryError>
Mark conversation as read
Sourcepub fn delete_message(&self, message_id: i64) -> Result<(), MessageHistoryError>
pub fn delete_message(&self, message_id: i64) -> Result<(), MessageHistoryError>
Delete message
Sourcepub fn delete_conversation(
&self,
rdx_fingerprint: &str,
) -> Result<(), MessageHistoryError>
pub fn delete_conversation( &self, rdx_fingerprint: &str, ) -> Result<(), MessageHistoryError>
Delete entire conversation
Auto Trait Implementations§
impl Freeze for MessageHistory
impl RefUnwindSafe for MessageHistory
impl Send for MessageHistory
impl Sync for MessageHistory
impl Unpin for MessageHistory
impl UnwindSafe for MessageHistory
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more