objc2-foundation 0.3.2

Bindings to the Foundation 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 crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsuuid?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(PartialEq, Eq, Hash)]
    pub struct NSUUID;
);

unsafe impl Send for NSUUID {}

unsafe impl Sync for NSUUID {}

#[cfg(feature = "NSObject")]
extern_conformance!(
    unsafe impl NSCoding for NSUUID {}
);

#[cfg(feature = "NSObject")]
extern_conformance!(
    unsafe impl NSCopying for NSUUID {}
);

#[cfg(feature = "NSObject")]
unsafe impl CopyingHelper for NSUUID {
    type Result = Self;
}

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

#[cfg(feature = "NSObject")]
extern_conformance!(
    unsafe impl NSSecureCoding for NSUUID {}
);

impl NSUUID {
    extern_methods!(
        #[unsafe(method(UUID))]
        #[unsafe(method_family = none)]
        pub fn UUID() -> Retained<Self>;

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

        #[cfg(feature = "NSString")]
        #[unsafe(method(initWithUUIDString:))]
        #[unsafe(method_family = init)]
        pub fn initWithUUIDString(
            this: Allocated<Self>,
            string: &NSString,
        ) -> Option<Retained<Self>>;

        #[cfg(feature = "NSObjCRuntime")]
        #[unsafe(method(compare:))]
        #[unsafe(method_family = none)]
        pub fn compare(&self, other_uuid: &NSUUID) -> NSComparisonResult;

        #[cfg(feature = "NSString")]
        #[unsafe(method(UUIDString))]
        #[unsafe(method_family = none)]
        pub fn UUIDString(&self) -> Retained<NSString>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSUUID {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for NSUUID {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}