#[derive(Debug)]
pub struct HandleDiagnostic {
pub total_handles: usize,
pub handles_with_multiple_ids: usize,
pub total_duplicated: usize,
}
#[derive(Debug)]
pub struct MessageDiagnostic {
pub total_messages: usize,
pub messages_without_chat: usize,
pub messages_in_multiple_chats: usize,
pub recoverable_messages: usize,
pub first_message_date: Option<i64>,
pub last_message_date: Option<i64>,
}
#[derive(Debug)]
pub struct AttachmentDiagnostic {
pub total_attachments: usize,
pub total_bytes_referenced: u64,
pub total_bytes_on_disk: u64,
pub missing_files: usize,
pub no_path_provided: usize,
}
impl AttachmentDiagnostic {
#[must_use]
pub fn no_file_located(&self) -> usize {
self.missing_files.saturating_sub(self.no_path_provided)
}
#[must_use]
pub fn missing_percent(&self) -> Option<f64> {
if self.total_attachments > 0 {
Some(self.missing_files as f64 / self.total_attachments as f64 * 100.0)
} else {
None
}
}
}
#[derive(Debug)]
pub struct ChatHandleDiagnostic {
pub total_chats: usize,
pub total_duplicated: usize,
pub chats_with_no_handles: usize,
}