Struct imessage_database::tables::handle::Handle
source · Expand description
Represents a single row in the handle table.
Fields§
§rowid: i32§id: String§person_centric_id: Option<String>Trait Implementations§
source§impl Cacheable for Handle
impl Cacheable for Handle
source§fn cache(db: &Connection) -> Result<HashMap<Self::K, Self::V>, TableError>
fn cache(db: &Connection) -> Result<HashMap<Self::K, Self::V>, TableError>
Generate a HashMap for looking up contacts by their IDs, collapsing duplicate contacts to the same ID String regardless of service
Example:
use imessage_database::util::dirs::default_db_path;
use imessage_database::tables::table::{Cacheable, get_connection};
use imessage_database::tables::handle::Handle;
let db_path = default_db_path();
let conn = get_connection(&db_path);
let chatrooms = Handle::cache(&conn);type K = i32
type V = String
source§impl Deduplicate for Handle
impl Deduplicate for Handle
source§fn dedupe(duplicated_data: &HashMap<i32, Self::T>) -> HashMap<i32, i32>
fn dedupe(duplicated_data: &HashMap<i32, Self::T>) -> HashMap<i32, i32>
Given the initial set of duplicated handles, deduplicate them
This returns a new hashmap that maps the real handle ID to a new deduplicated unique handle ID that represents a single handle for all of the deduplicate handles
type T = String
source§impl Diagnostic for Handle
impl Diagnostic for Handle
source§fn run_diagnostic(db: &Connection)
fn run_diagnostic(db: &Connection)
Emit diagnostic data for the Handles table
Get the number of handles that are duplicated The person_centric_id is used to map handles that represent the same contact across ids (numbers, emails, etc) and across services (iMessage, Jabber, iChat, SMS, etc)
Example:
use imessage_database::util::dirs::default_db_path;
use imessage_database::tables::table::{Diagnostic, get_connection};
use imessage_database::tables::handle::Handle;
let db_path = default_db_path();
let conn = get_connection(&db_path);
Handle::run_diagnostic(&conn);