objc2_core_data/generated/
NSPersistentHistoryChange.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
9/// [Apple's documentation](https://developer.apple.com/documentation/coredata/nspersistenthistorychangetype?language=objc)
10// NS_ENUM
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct NSPersistentHistoryChangeType(pub NSInteger);
14impl NSPersistentHistoryChangeType {
15    #[doc(alias = "NSPersistentHistoryChangeTypeInsert")]
16    pub const Insert: Self = Self(0);
17    #[doc(alias = "NSPersistentHistoryChangeTypeUpdate")]
18    pub const Update: Self = Self(1);
19    #[doc(alias = "NSPersistentHistoryChangeTypeDelete")]
20    pub const Delete: Self = Self(2);
21}
22
23unsafe impl Encode for NSPersistentHistoryChangeType {
24    const ENCODING: Encoding = NSInteger::ENCODING;
25}
26
27unsafe impl RefEncode for NSPersistentHistoryChangeType {
28    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
29}
30
31extern_class!(
32    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nspersistenthistorychange?language=objc)
33    #[unsafe(super(NSObject))]
34    #[derive(Debug, PartialEq, Eq, Hash)]
35    pub struct NSPersistentHistoryChange;
36);
37
38extern_conformance!(
39    unsafe impl NSCopying for NSPersistentHistoryChange {}
40);
41
42unsafe impl CopyingHelper for NSPersistentHistoryChange {
43    type Result = Self;
44}
45
46extern_conformance!(
47    unsafe impl NSObjectProtocol for NSPersistentHistoryChange {}
48);
49
50impl NSPersistentHistoryChange {
51    extern_methods!(
52        #[cfg(all(feature = "NSEntityDescription", feature = "NSManagedObjectContext"))]
53        #[unsafe(method(entityDescriptionWithContext:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn entityDescriptionWithContext(
56            context: &NSManagedObjectContext,
57        ) -> Option<Retained<NSEntityDescription>>;
58
59        #[cfg(feature = "NSEntityDescription")]
60        #[unsafe(method(entityDescription))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn entityDescription() -> Option<Retained<NSEntityDescription>>;
63
64        #[cfg(all(feature = "NSFetchRequest", feature = "NSPersistentStoreRequest"))]
65        #[unsafe(method(fetchRequest))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn fetchRequest() -> Option<Retained<NSFetchRequest>>;
68
69        #[unsafe(method(changeID))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn changeID(&self) -> i64;
72
73        #[cfg(feature = "NSManagedObjectID")]
74        #[unsafe(method(changedObjectID))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn changedObjectID(&self) -> Retained<NSManagedObjectID>;
77
78        #[unsafe(method(changeType))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn changeType(&self) -> NSPersistentHistoryChangeType;
81
82        #[unsafe(method(tombstone))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn tombstone(&self) -> Option<Retained<NSDictionary>>;
85
86        #[cfg(feature = "NSPersistentHistoryTransaction")]
87        #[unsafe(method(transaction))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn transaction(&self) -> Option<Retained<NSPersistentHistoryTransaction>>;
90
91        #[cfg(feature = "NSPropertyDescription")]
92        #[unsafe(method(updatedProperties))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn updatedProperties(&self) -> Option<Retained<NSSet<NSPropertyDescription>>>;
95    );
96}
97
98/// Methods declared on superclass `NSObject`.
99impl NSPersistentHistoryChange {
100    extern_methods!(
101        #[unsafe(method(init))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
104
105        #[unsafe(method(new))]
106        #[unsafe(method_family = new)]
107        pub unsafe fn new() -> Retained<Self>;
108    );
109}