objc2-mail-kit 0.3.2

Bindings to the MailKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// Contain information about an email address. This can include both valid and invalid email addresses.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mailkit/meemailaddress?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MEEmailAddress;
);

extern_conformance!(
    unsafe impl NSCoding for MEEmailAddress {}
);

extern_conformance!(
    unsafe impl NSCopying for MEEmailAddress {}
);

unsafe impl CopyingHelper for MEEmailAddress {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for MEEmailAddress {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for MEEmailAddress {}
);

impl MEEmailAddress {
    extern_methods!(
        /// The raw string for the email address.
        #[unsafe(method(rawString))]
        #[unsafe(method_family = none)]
        pub unsafe fn rawString(&self) -> Retained<NSString>;

        /// The simple address string portion of the raw string if it is valid. For example, the
        /// `addressString`of "John Appleseed <j.appleseed@example.com>" will be "j.appleseed@example.com".
        #[unsafe(method(addressString))]
        #[unsafe(method_family = none)]
        pub unsafe fn addressString(&self) -> Option<Retained<NSString>>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(initWithRawString:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithRawString(
            this: Allocated<Self>,
            raw_string: &NSString,
        ) -> Retained<Self>;
    );
}