Struct imessage_database::tables::attachment::Attachment
source · pub struct Attachment {
pub rowid: i32,
pub filename: Option<String>,
pub uti: Option<String>,
pub mime_type: Option<String>,
pub transfer_name: Option<String>,
pub total_bytes: i64,
pub hide_attachment: i32,
pub copied_path: Option<PathBuf>,
}Expand description
Represents a single row in the attachment table.
Fields§
§rowid: i32§filename: Option<String>§uti: Option<String>§mime_type: Option<String>§transfer_name: Option<String>§total_bytes: i64§hide_attachment: i32§copied_path: Option<PathBuf>Implementations§
source§impl Attachment
impl Attachment
sourcepub fn from_message(
db: &Connection,
msg: &Message
) -> Result<Vec<Attachment>, TableError>
pub fn from_message( db: &Connection, msg: &Message ) -> Result<Vec<Attachment>, TableError>
Gets a Vector of attachments for a single message
sourcepub fn resolved_attachment_path(
&self,
platform: &Platform,
db_path: &Path
) -> Option<String>
pub fn resolved_attachment_path( &self, platform: &Platform, db_path: &Path ) -> Option<String>
Given a platform and database source, resolve the path for the current attachment
For macOS, db_path is unused. For iOS, db_path is the path to the root of the backup directory.
iOS Parsing logic source is from here.
sourcepub fn run_diagnostic(
db: &Connection,
db_path: &Path,
platform: &Platform
) -> Result<(), TableError>
pub fn run_diagnostic( db: &Connection, db_path: &Path, platform: &Platform ) -> Result<(), TableError>
Emit diagnostic data for the Attachments table
This is defined outside of crate::tables::table::Diagnostic because it requires additional data.
Get the number of attachments that are missing from the filesystem or are missing one of the following columns:
- ck_server_change_token_blob
- sr_ck_server_change_token_blob
Example:
use imessage_database::util::{dirs::default_db_path, platform::Platform};
use imessage_database::tables::table::{Diagnostic, get_connection};
use imessage_database::tables::attachment::Attachment;
let db_path = default_db_path();
let conn = get_connection(&db_path).unwrap();
Attachment::run_diagnostic(&conn, &db_path, &Platform::macOS);Trait Implementations§
source§impl Debug for Attachment
impl Debug for Attachment
source§impl Table for Attachment
impl Table for Attachment
source§fn from_row(row: &Row<'_>) -> Result<Attachment>
fn from_row(row: &Row<'_>) -> Result<Attachment>
Serializes a single row of data to an instance of the struct that implements this Trait
source§fn get(db: &Connection) -> Result<Statement<'_>, TableError>
fn get(db: &Connection) -> Result<Statement<'_>, TableError>
Gets a statement we can execute to iterate over the data in the table
Auto Trait Implementations§
impl RefUnwindSafe for Attachment
impl Send for Attachment
impl Sync for Attachment
impl Unpin for Attachment
impl UnwindSafe for Attachment
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