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

source§

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 Debug for Handle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deduplicate for Handle

source§

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

source§

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).unwrap();
Handle::run_diagnostic(&conn);
source§

impl Table for Handle

source§

fn from_row(row: &Row<'_>) -> Result<Handle>

Serializes a single row of data to an instance of the struct that implements this Trait
source§

fn get(db: &Connection) -> Result<Statement<'_>, TableError>

Gets a statement we can execute to iterate over the data in the table
source§

fn extract( handle: Result<Result<Self, Error>, Error> ) -> Result<Self, TableError>

Extract valid row data while handling both types of query errors

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.