Struct imessage_database::tables::handle::Handle
source · pub struct Handle {
pub rowid: i32,
pub id: String,
pub person_centric_id: Option<String>,
}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).unwrap();
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) -> Result<(), TableError>
fn run_diagnostic(db: &Connection) -> Result<(), TableError>
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).unwrap();
Handle::run_diagnostic(&conn);source§impl Table for Handle
impl Table for Handle
Auto Trait Implementations§
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
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