icrate/generated/Foundation/
NSOrderedCollectionDifference.rs1use crate::common::*;
4use crate::Foundation::*;
5
6ns_options!(
7 #[underlying(NSUInteger)]
8 pub enum NSOrderedCollectionDifferenceCalculationOptions {
9 NSOrderedCollectionDifferenceCalculationOmitInsertedObjects = 1 << 0,
10 NSOrderedCollectionDifferenceCalculationOmitRemovedObjects = 1 << 1,
11 NSOrderedCollectionDifferenceCalculationInferMoves = 1 << 2,
12 }
13);
14
15__inner_extern_class!(
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 #[cfg(feature = "Foundation_NSOrderedCollectionDifference")]
18 pub struct NSOrderedCollectionDifference<ObjectType: ?Sized = AnyObject> {
19 __superclass: NSObject,
20 _inner0: PhantomData<*mut ObjectType>,
21 notunwindsafe: PhantomData<&'static mut ()>,
22 }
23
24 #[cfg(feature = "Foundation_NSOrderedCollectionDifference")]
25 unsafe impl<ObjectType: ?Sized + Message> ClassType for NSOrderedCollectionDifference<ObjectType> {
26 type Super = NSObject;
27 type Mutability = InteriorMutable;
28
29 fn as_super(&self) -> &Self::Super {
30 &self.__superclass
31 }
32
33 fn as_super_mut(&mut self) -> &mut Self::Super {
34 &mut self.__superclass
35 }
36 }
37);
38
39#[cfg(feature = "Foundation_NSOrderedCollectionDifference")]
40unsafe impl<ObjectType: ?Sized> NSFastEnumeration for NSOrderedCollectionDifference<ObjectType> {}
41
42#[cfg(feature = "Foundation_NSOrderedCollectionDifference")]
43unsafe impl<ObjectType: ?Sized> NSObjectProtocol for NSOrderedCollectionDifference<ObjectType> {}
44
45extern_methods!(
46 #[cfg(feature = "Foundation_NSOrderedCollectionDifference")]
47 unsafe impl<ObjectType: Message> NSOrderedCollectionDifference<ObjectType> {
48 #[cfg(all(
49 feature = "Foundation_NSArray",
50 feature = "Foundation_NSOrderedCollectionChange"
51 ))]
52 #[method_id(@__retain_semantics Init initWithChanges:)]
53 pub unsafe fn initWithChanges(
54 this: Allocated<Self>,
55 changes: &NSArray<NSOrderedCollectionChange<ObjectType>>,
56 ) -> Id<Self>;
57
58 #[cfg(all(
59 feature = "Foundation_NSArray",
60 feature = "Foundation_NSIndexSet",
61 feature = "Foundation_NSOrderedCollectionChange"
62 ))]
63 #[method_id(@__retain_semantics Init initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:)]
64 pub unsafe fn initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges(
65 this: Allocated<Self>,
66 inserts: &NSIndexSet,
67 inserted_objects: Option<&NSArray<ObjectType>>,
68 removes: &NSIndexSet,
69 removed_objects: Option<&NSArray<ObjectType>>,
70 changes: &NSArray<NSOrderedCollectionChange<ObjectType>>,
71 ) -> Id<Self>;
72
73 #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSIndexSet"))]
74 #[method_id(@__retain_semantics Init initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:)]
75 pub unsafe fn initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects(
76 this: Allocated<Self>,
77 inserts: &NSIndexSet,
78 inserted_objects: Option<&NSArray<ObjectType>>,
79 removes: &NSIndexSet,
80 removed_objects: Option<&NSArray<ObjectType>>,
81 ) -> Id<Self>;
82
83 #[cfg(all(
84 feature = "Foundation_NSArray",
85 feature = "Foundation_NSOrderedCollectionChange"
86 ))]
87 #[method_id(@__retain_semantics Other insertions)]
88 pub unsafe fn insertions(&self) -> Id<NSArray<NSOrderedCollectionChange<ObjectType>>>;
89
90 #[cfg(all(
91 feature = "Foundation_NSArray",
92 feature = "Foundation_NSOrderedCollectionChange"
93 ))]
94 #[method_id(@__retain_semantics Other removals)]
95 pub unsafe fn removals(&self) -> Id<NSArray<NSOrderedCollectionChange<ObjectType>>>;
96
97 #[method(hasChanges)]
98 pub unsafe fn hasChanges(&self) -> bool;
99
100 #[cfg(feature = "Foundation_NSOrderedCollectionChange")]
101 #[method_id(@__retain_semantics Other differenceByTransformingChangesWithBlock:)]
102 pub unsafe fn differenceByTransformingChangesWithBlock(
103 &self,
104 block: &Block<
105 (NonNull<NSOrderedCollectionChange<ObjectType>>,),
106 NonNull<NSOrderedCollectionChange<AnyObject>>,
107 >,
108 ) -> Id<NSOrderedCollectionDifference<AnyObject>>;
109
110 #[method_id(@__retain_semantics Other inverseDifference)]
111 pub unsafe fn inverseDifference(&self) -> Id<Self>;
112 }
113);
114
115extern_methods!(
116 #[cfg(feature = "Foundation_NSOrderedCollectionDifference")]
118 unsafe impl<ObjectType: Message> NSOrderedCollectionDifference<ObjectType> {
119 #[method_id(@__retain_semantics Init init)]
120 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
121
122 #[method_id(@__retain_semantics New new)]
123 pub unsafe fn new() -> Id<Self>;
124 }
125);