objc2_mail_kit/generated/
MEEmailAddress.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// Contain information about an email address. This can include both valid and invalid email addresses.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/mailkit/meemailaddress?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct MEEmailAddress;
16);
17
18extern_conformance!(
19    unsafe impl NSCoding for MEEmailAddress {}
20);
21
22extern_conformance!(
23    unsafe impl NSCopying for MEEmailAddress {}
24);
25
26unsafe impl CopyingHelper for MEEmailAddress {
27    type Result = Self;
28}
29
30extern_conformance!(
31    unsafe impl NSObjectProtocol for MEEmailAddress {}
32);
33
34extern_conformance!(
35    unsafe impl NSSecureCoding for MEEmailAddress {}
36);
37
38impl MEEmailAddress {
39    extern_methods!(
40        /// The raw string for the email address.
41        #[unsafe(method(rawString))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn rawString(&self) -> Retained<NSString>;
44
45        /// The simple address string portion of the raw string if it is valid. For example, the
46        /// `addressString`of "John Appleseed <j.appleseed@example.com>" will be "j.appleseed@example.com".
47        #[unsafe(method(addressString))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn addressString(&self) -> Option<Retained<NSString>>;
50
51        #[unsafe(method(new))]
52        #[unsafe(method_family = new)]
53        pub unsafe fn new() -> Retained<Self>;
54
55        #[unsafe(method(init))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
58
59        #[unsafe(method(initWithRawString:))]
60        #[unsafe(method_family = init)]
61        pub unsafe fn initWithRawString(
62            this: Allocated<Self>,
63            raw_string: &NSString,
64        ) -> Retained<Self>;
65    );
66}