pub struct MessageRepository { /* private fields */ }Expand description
The iMessage database repository.
Implementations§
Source§impl MessageRepository
impl MessageRepository
Sourcepub fn open(db_path: PathBuf) -> Result<Self>
pub fn open(db_path: PathBuf) -> Result<Self>
Open the iMessage database in read-only mode and detect its schema.
Sourcepub fn get_message_count(&self, params: &MessageCountParams) -> Result<i64>
pub fn get_message_count(&self, params: &MessageCountParams) -> Result<i64>
Count all messages, with optional filters.
Sourcepub fn get_chat_count(&self) -> Result<i64>
pub fn get_chat_count(&self) -> Result<i64>
Count all chats.
Sourcepub fn get_handle_count(&self, address: Option<&str>) -> Result<i64>
pub fn get_handle_count(&self, address: Option<&str>) -> Result<i64>
Count all handles, optionally filtered by address.
Sourcepub fn get_attachment_count(&self) -> Result<i64>
pub fn get_attachment_count(&self) -> Result<i64>
Count all attachments.
Sourcepub fn get_message(
&self,
guid: &str,
with_chats: bool,
with_attachments: bool,
) -> Result<Option<Message>>
pub fn get_message( &self, guid: &str, with_chats: bool, with_attachments: bool, ) -> Result<Option<Message>>
Get a single message by GUID, optionally with chats and attachments.
Sourcepub fn get_attachment(
&self,
attachment_guid: &str,
) -> Result<Option<Attachment>>
pub fn get_attachment( &self, attachment_guid: &str, ) -> Result<Option<Attachment>>
Get a single attachment by GUID (handles prefix stripping).
Sourcepub fn get_imessage_account(&self) -> Result<Option<String>>
pub fn get_imessage_account(&self) -> Result<Option<String>>
Get the iMessage account login string.
Sourcepub fn get_chat_last_message(&self, chat_guid: &str) -> Result<Option<Message>>
pub fn get_chat_last_message(&self, chat_guid: &str) -> Result<Option<Message>>
Get the last message in a chat by GUID.
Sourcepub fn get_messages(
&self,
params: &MessageQueryParams,
) -> Result<(Vec<Message>, i64)>
pub fn get_messages( &self, params: &MessageQueryParams, ) -> Result<(Vec<Message>, i64)>
Get messages with pagination and filters. Returns (messages, total_count).
Sourcepub fn get_updated_messages(
&self,
params: &UpdatedMessageQueryParams,
) -> Result<Vec<Message>>
pub fn get_updated_messages( &self, params: &UpdatedMessageQueryParams, ) -> Result<Vec<Message>>
Get updated messages (delivered, read, edited, retracted since a date).
Sourcepub fn get_chats(&self, params: &ChatQueryParams) -> Result<(Vec<Chat>, i64)>
pub fn get_chats(&self, params: &ChatQueryParams) -> Result<(Vec<Chat>, i64)>
Get chats with pagination and filters. Returns (chats, total_count).
Sourcepub fn get_handles(
&self,
params: &HandleQueryParams,
) -> Result<(Vec<Handle>, i64)>
pub fn get_handles( &self, params: &HandleQueryParams, ) -> Result<(Vec<Handle>, i64)>
Get handles with pagination. Returns (handles, total_count).
Sourcepub fn get_attachments_for_message(
&self,
message_rowid: i64,
) -> Result<Vec<Attachment>>
pub fn get_attachments_for_message( &self, message_rowid: i64, ) -> Result<Vec<Attachment>>
Get all attachments for a message by message ROWID.
Sourcepub fn get_chats_read_since(&self, after_apple_ts: i64) -> Result<Vec<Chat>>
pub fn get_chats_read_since(&self, after_apple_ts: i64) -> Result<Vec<Chat>>
Get chats whose last_read_message_timestamp >= the given Apple timestamp.
Used by the chat update poller to detect read status changes.
Auto Trait Implementations§
impl !Freeze for MessageRepository
impl !RefUnwindSafe for MessageRepository
impl Send for MessageRepository
impl !Sync for MessageRepository
impl Unpin for MessageRepository
impl UnsafeUnpin for MessageRepository
impl !UnwindSafe for MessageRepository
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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