use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Folder {
pub name: String,
pub path: String,
pub unread_count: u32,
pub total_count: u32,
pub mailbox_hash: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MessageSummary {
pub uid: u64,
pub subject: String,
pub from: String,
pub to: String,
pub date: String,
pub is_read: bool,
pub is_starred: bool,
pub has_attachments: bool,
pub thread_id: Option<u64>,
pub envelope_hash: u64,
pub timestamp: i64,
pub mailbox_hash: u64,
pub message_id: String,
pub in_reply_to: Option<String>,
pub reply_to: Option<String>,
pub thread_depth: u32,
}
#[derive(Debug, Clone)]
pub struct AttachmentData {
pub filename: String,
pub mime_type: String,
pub data: Vec<u8>,
}
impl AttachmentData {
pub fn is_image(&self) -> bool {
self.mime_type
.to_ascii_lowercase()
.starts_with("image/")
}
}