rust_macios/contacts/
cn_mutable_postal_address.rs1use objc::{msg_send, sel, sel_impl};
2
3use crate::{foundation::NSString, object, objective_c_runtime::macros::interface_impl};
4
5use super::ICNPostalAddress;
6
7object! {
8 unsafe pub struct CNMutablePostalAddress;
10}
11
12impl ICNPostalAddress for CNMutablePostalAddress {}
13
14#[interface_impl(CNPostalAddress)]
15impl CNMutablePostalAddress {
16 #[property]
21 pub fn set_street(&mut self, street: NSString) {
22 unsafe { msg_send![self.m_self(), setStreet: street] }
23 }
24
25 #[property]
27 pub fn set_city(&mut self, city: NSString) {
28 unsafe { msg_send![self.m_self(), setCity: city] }
29 }
30
31 #[property]
33 pub fn set_state(&mut self, state: NSString) {
34 unsafe { msg_send![self.m_self(), setState: state] }
35 }
36
37 #[property]
39 pub fn set_postal_code(&mut self, postal_code: NSString) {
40 unsafe { msg_send![self.m_self(), setPostalCode: postal_code] }
41 }
42
43 #[property]
45 pub fn set_country(&mut self, country: NSString) {
46 unsafe { msg_send![self.m_self(), setCountry: country] }
47 }
48
49 #[property]
51 pub fn set_iso_country_code(&mut self, iso_country_code: NSString) {
52 unsafe { msg_send![self.m_self(), setISOCountryCode: iso_country_code] }
53 }
54
55 #[property]
57 pub fn set_sub_administrative_area(&mut self, sub_administrative_area: NSString) {
58 unsafe {
59 msg_send![
60 self.m_self(),
61 setSubAdministrativeArea: sub_administrative_area
62 ]
63 }
64 }
65
66 #[property]
68 pub fn set_sub_locality(&mut self, sub_locality: NSString) {
69 unsafe { msg_send![self.m_self(), setSubLocality: sub_locality] }
70 }
71}