objc2-core-data 0.3.2

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

use crate::*;

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

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

impl NSAtomicStoreCacheNode {
    extern_methods!(
        #[cfg(feature = "NSManagedObjectID")]
        #[unsafe(method(initWithObjectID:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithObjectID(
            this: Allocated<Self>,
            moid: &NSManagedObjectID,
        ) -> Retained<Self>;

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

        /// # Safety
        ///
        /// The returned generic should be of the correct type.
        #[unsafe(method(propertyCache))]
        #[unsafe(method_family = none)]
        pub unsafe fn propertyCache(
            &self,
        ) -> Option<Retained<NSMutableDictionary<NSString, AnyObject>>>;

        /// Setter for [`propertyCache`][Self::propertyCache].
        ///
        /// # Safety
        ///
        /// `property_cache` generic should be of the correct type.
        #[unsafe(method(setPropertyCache:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPropertyCache(
            &self,
            property_cache: Option<&NSMutableDictionary<NSString, AnyObject>>,
        );

        #[unsafe(method(valueForKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn valueForKey(&self, key: &NSString) -> Option<Retained<AnyObject>>;

        /// # Safety
        ///
        /// `value` should be of the correct type.
        #[unsafe(method(setValue:forKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setValue_forKey(&self, value: Option<&AnyObject>, key: &NSString);
    );
}

/// Methods declared on superclass `NSObject`.
impl NSAtomicStoreCacheNode {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

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