pub struct Attachment {
    pub rowid: i32,
    pub filename: Option<String>,
    pub mime_type: Option<String>,
    pub transfer_name: String,
    pub total_bytes: i32,
    pub is_sticker: i32,
    pub attribution_info: Option<Vec<u8>>,
    pub hide_attachment: i32,
    pub copied_path: Option<String>,
}
Expand description

Represents a single row in the attachment table.

Fields§

§rowid: i32§filename: Option<String>§mime_type: Option<String>§transfer_name: String§total_bytes: i32§is_sticker: i32§attribution_info: Option<Vec<u8>>§hide_attachment: i32§copied_path: Option<String>

Implementations§

Get the media type of an attachment

Get the path to an attachment, if it exists

Get the extension of an attachment, if it exists

Trait Implementations§

Formats the value using the given formatter. Read more

Emit diagnotsic data for the Attachments table

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;
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);
Attachment::run_diagnostic(&conn);
Serializes a single row of data to an instance of the struct that implements this Trait
Gets a statment we can exectue to iterate over the data in the table
Extract valid row data while handling both types of query errors

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.