objc2_core_data/generated/
NSFetchIndexElementDescription.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSFetchIndexElementType(pub NSUInteger);
15impl NSFetchIndexElementType {
16 #[doc(alias = "NSFetchIndexElementTypeBinary")]
17 pub const Binary: Self = Self(0);
18 #[doc(alias = "NSFetchIndexElementTypeRTree")]
19 pub const RTree: Self = Self(1);
20}
21
22unsafe impl Encode for NSFetchIndexElementType {
23 const ENCODING: Encoding = NSUInteger::ENCODING;
24}
25
26unsafe impl RefEncode for NSFetchIndexElementType {
27 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
28}
29
30extern_class!(
31 #[unsafe(super(NSObject))]
33 #[derive(Debug, PartialEq, Eq, Hash)]
34 pub struct NSFetchIndexElementDescription;
35);
36
37unsafe impl NSCoding for NSFetchIndexElementDescription {}
38
39unsafe impl NSCopying for NSFetchIndexElementDescription {}
40
41unsafe impl CopyingHelper for NSFetchIndexElementDescription {
42 type Result = Self;
43}
44
45unsafe impl NSObjectProtocol for NSFetchIndexElementDescription {}
46
47impl NSFetchIndexElementDescription {
48 extern_methods!(
49 #[cfg(feature = "NSPropertyDescription")]
50 #[unsafe(method(initWithProperty:collationType:))]
51 #[unsafe(method_family = init)]
52 pub unsafe fn initWithProperty_collationType(
53 this: Allocated<Self>,
54 property: &NSPropertyDescription,
55 collation_type: NSFetchIndexElementType,
56 ) -> Retained<Self>;
57
58 #[cfg(feature = "NSPropertyDescription")]
59 #[unsafe(method(property))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn property(&self) -> Option<Retained<NSPropertyDescription>>;
62
63 #[unsafe(method(propertyName))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn propertyName(&self) -> Option<Retained<NSString>>;
66
67 #[unsafe(method(collationType))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn collationType(&self) -> NSFetchIndexElementType;
70
71 #[unsafe(method(setCollationType:))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn setCollationType(&self, collation_type: NSFetchIndexElementType);
75
76 #[unsafe(method(isAscending))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn isAscending(&self) -> bool;
79
80 #[unsafe(method(setAscending:))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn setAscending(&self, ascending: bool);
84
85 #[cfg(feature = "NSFetchIndexDescription")]
86 #[unsafe(method(indexDescription))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn indexDescription(&self) -> Option<Retained<NSFetchIndexDescription>>;
89 );
90}
91
92impl NSFetchIndexElementDescription {
94 extern_methods!(
95 #[unsafe(method(init))]
96 #[unsafe(method_family = init)]
97 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
98
99 #[unsafe(method(new))]
100 #[unsafe(method_family = new)]
101 pub unsafe fn new() -> Retained<Self>;
102 );
103}