#[repr(C)]pub struct CNContact {
pub ptr: Id<Object>,
}
Expand description
An immutable object that stores information about a single contact, such as the contact’s first name, phone numbers, and addresses.
Fields§
§ptr: Id<Object>
The raw pointer to the Objective-C object.
Implementations§
Source§impl CNContact
impl CNContact
Sourcepub fn identifier(&self) -> NSString
pub fn identifier(&self) -> NSString
A value that uniquely identifies a contact on the device.
Sourcepub fn contact_type(&self) -> CNContactType
pub fn contact_type(&self) -> CNContactType
An enum identifying the contact type.
Sourcepub fn name_prefix(&self) -> NSString
pub fn name_prefix(&self) -> NSString
The name prefix of the contact.
Sourcepub fn given_name(&self) -> NSString
pub fn given_name(&self) -> NSString
The given name of the contact.
Sourcepub fn middle_name(&self) -> NSString
pub fn middle_name(&self) -> NSString
The middle name of the contact.
Sourcepub fn family_name(&self) -> NSString
pub fn family_name(&self) -> NSString
A string for the previous family name of the contact.
Sourcepub fn previous_family_name(&self) -> NSString
pub fn previous_family_name(&self) -> NSString
A string for the previous family name of the contact.
Sourcepub fn name_suffix(&self) -> NSString
pub fn name_suffix(&self) -> NSString
The name suffix of the contact.
Sourcepub fn phonetic_given_name(&self) -> NSString
pub fn phonetic_given_name(&self) -> NSString
The phonetic given name of the contact.
Sourcepub fn phonetic_middle_name(&self) -> NSString
pub fn phonetic_middle_name(&self) -> NSString
The phonetic middle name of the contact.
Sourcepub fn phonetic_family_name(&self) -> NSString
pub fn phonetic_family_name(&self) -> NSString
The phonetic family name of the contact.
Sourcepub fn department_name(&self) -> NSString
pub fn department_name(&self) -> NSString
The name of the department associated with the contact.
Sourcepub fn organization_name(&self) -> NSString
pub fn organization_name(&self) -> NSString
The name of the organization associated with the contact.
Sourcepub fn phonetic_organization_name(&self) -> NSString
pub fn phonetic_organization_name(&self) -> NSString
The phonetic name of the organization associated with the contact.
Sourcepub fn postal_addresses(&self) -> NSArray<CNLabeledValue<CNPostalAddress>>
pub fn postal_addresses(&self) -> NSArray<CNLabeledValue<CNPostalAddress>>
An array of labeled postal addresses for a contact.
Sourcepub fn email_addresses(&self) -> NSArray<CNLabeledValue<NSString>>
pub fn email_addresses(&self) -> NSArray<CNLabeledValue<NSString>>
An array of labeled email addresses for the contact.
Sourcepub fn url_addresses(&self) -> NSArray<CNLabeledValue<NSString>>
pub fn url_addresses(&self) -> NSArray<CNLabeledValue<NSString>>
An array of labeled URL addresses for a contact.
Sourcepub fn phone_numbers(&self) -> NSArray<CNLabeledValue<CNPhoneNumber>>
pub fn phone_numbers(&self) -> NSArray<CNLabeledValue<CNPhoneNumber>>
An array of labeled phone numbers for a contact.
An array of labeled social profiles for a contact.
Sourcepub fn birthday(&self) -> Option<NSDateComponents>
pub fn birthday(&self) -> Option<NSDateComponents>
A date component for the Gregorian birthday of the contact.
Sourcepub fn non_gregorian_birthday(&self) -> Option<NSDateComponents>
pub fn non_gregorian_birthday(&self) -> Option<NSDateComponents>
A date component for the non-Gregorian birthday of the contact.
Sourcepub fn dates(&self) -> NSArray<CNLabeledValue<NSDateComponents>>
pub fn dates(&self) -> NSArray<CNLabeledValue<NSDateComponents>>
An array containing labeled Gregorian dates.
Sourcepub fn image_data(&self) -> Option<NSData>
pub fn image_data(&self) -> Option<NSData>
The profile picture of a contact.
Sourcepub fn thumbnail_image_data(&self) -> Option<NSData>
pub fn thumbnail_image_data(&self) -> Option<NSData>
The thumbnail version of the contact’s profile picture.
Sourcepub fn image_data_available(&self) -> bool
pub fn image_data_available(&self) -> bool
A Boolean indicating whether a contact has a profile picture.
Sourcepub fn contact_relations(&self) -> NSArray<CNLabeledValue<CNContactRelation>>
pub fn contact_relations(&self) -> NSArray<CNLabeledValue<CNContactRelation>>
An array of labeled relations for the contact.
Sourcepub fn instant_messaging_addresses(
&self,
) -> NSArray<CNLabeledValue<CNInstantMessageAddress>>
pub fn instant_messaging_addresses( &self, ) -> NSArray<CNLabeledValue<CNInstantMessageAddress>>
An array of labeled IM addresses for the contact.
Sourcepub fn localized_string_for_key(property: NSString) -> NSString
pub fn localized_string_for_key(property: NSString) -> NSString
Returns a string containing the localized contact property name.
Sourcepub fn descriptor_for_all_comparator_keys() -> id
pub fn descriptor_for_all_comparator_keys() -> id
Fetches all the keys required for the contact sort comparator.
Sourcepub fn comparator_for_name_sort_order(
sort_order: CNContactSortOrder,
) -> NSComparator
pub fn comparator_for_name_sort_order( sort_order: CNContactSortOrder, ) -> NSComparator
Returns a comparator to sort contacts with the specified order.
Sourcepub fn is_unified_with_contact_with_identifier(
&self,
identifier: NSString,
) -> bool
pub fn is_unified_with_contact_with_identifier( &self, identifier: NSString, ) -> bool
Returns a Boolean indicating whether the current contact is a unified contact and includes a contact with the specified identifier.
Sourcepub fn is_key_available(&self, key: NSString) -> bool
pub fn is_key_available(&self, key: NSString) -> bool
Determines whether the contact property value for the specified key is fetched.
Sourcepub fn are_keys_available(&self, key_descriptors: NSArray<id>) -> bool
pub fn are_keys_available(&self, key_descriptors: NSArray<id>) -> bool
Determines whether all contact property values for the specified keys are fetched.
Sourcepub fn predicate_for_contacts_matching_name(name: NSString) -> NSPredicate
pub fn predicate_for_contacts_matching_name(name: NSString) -> NSPredicate
Returns a predicate to find the contacts matching the specified name.
Sourcepub fn predicate_for_contacts_with_identifiers(
identifiers: NSArray<String>,
) -> NSPredicate
pub fn predicate_for_contacts_with_identifiers( identifiers: NSArray<String>, ) -> NSPredicate
Returns a predicate to find the contacts matching the specified identifiers.
Sourcepub fn predicate_for_contacts_in_group_with_identifier(
group: NSString,
) -> NSPredicate
pub fn predicate_for_contacts_in_group_with_identifier( group: NSString, ) -> NSPredicate
Returns a predicate to find the contacts that are members in the specified group.
Sourcepub fn predicate_for_contacts_in_container_with_identifier(
container: NSString,
) -> NSPredicate
pub fn predicate_for_contacts_in_container_with_identifier( container: NSString, ) -> NSPredicate
Returns a predicate to find the contacts in the specified container.
Sourcepub fn predicate_for_contacts_matching_phone_number(
phone_number: CNPhoneNumber,
) -> NSPredicate
pub fn predicate_for_contacts_matching_phone_number( phone_number: CNPhoneNumber, ) -> NSPredicate
Returns a predicate to find the contacts whose phone number matches the specified value.
Sourcepub fn predicate_for_contacts_matching_email_address(
email_address: NSString,
) -> NSPredicate
pub fn predicate_for_contacts_matching_email_address( email_address: NSString, ) -> NSPredicate
Returns a predicate to find the contacts whose email address matches the specified value.
Methods from Deref<Target = Object>§
Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Returns a reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
Sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Returns a mutable reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.