objc2_core_data/generated/
NSFetchIndexElementDescription.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/coredata/nsfetchindexelementtype?language=objc)
11// NS_ENUM
12#[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    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nsfetchindexelementdescription?language=objc)
32    #[unsafe(super(NSObject))]
33    #[derive(Debug, PartialEq, Eq, Hash)]
34    pub struct NSFetchIndexElementDescription;
35);
36
37extern_conformance!(
38    unsafe impl NSCoding for NSFetchIndexElementDescription {}
39);
40
41extern_conformance!(
42    unsafe impl NSCopying for NSFetchIndexElementDescription {}
43);
44
45unsafe impl CopyingHelper for NSFetchIndexElementDescription {
46    type Result = Self;
47}
48
49extern_conformance!(
50    unsafe impl NSObjectProtocol for NSFetchIndexElementDescription {}
51);
52
53impl NSFetchIndexElementDescription {
54    extern_methods!(
55        #[cfg(feature = "NSPropertyDescription")]
56        #[unsafe(method(initWithProperty:collationType:))]
57        #[unsafe(method_family = init)]
58        pub unsafe fn initWithProperty_collationType(
59            this: Allocated<Self>,
60            property: &NSPropertyDescription,
61            collation_type: NSFetchIndexElementType,
62        ) -> Retained<Self>;
63
64        #[cfg(feature = "NSPropertyDescription")]
65        #[unsafe(method(property))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn property(&self) -> Option<Retained<NSPropertyDescription>>;
68
69        #[unsafe(method(propertyName))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn propertyName(&self) -> Option<Retained<NSString>>;
72
73        #[unsafe(method(collationType))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn collationType(&self) -> NSFetchIndexElementType;
76
77        /// Setter for [`collationType`][Self::collationType].
78        #[unsafe(method(setCollationType:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn setCollationType(&self, collation_type: NSFetchIndexElementType);
81
82        #[unsafe(method(isAscending))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn isAscending(&self) -> bool;
85
86        /// Setter for [`isAscending`][Self::isAscending].
87        #[unsafe(method(setAscending:))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn setAscending(&self, ascending: bool);
90
91        #[cfg(feature = "NSFetchIndexDescription")]
92        /// # Safety
93        ///
94        /// This is not retained internally, you must ensure the object is still alive.
95        #[unsafe(method(indexDescription))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn indexDescription(&self) -> Option<Retained<NSFetchIndexDescription>>;
98    );
99}
100
101/// Methods declared on superclass `NSObject`.
102impl NSFetchIndexElementDescription {
103    extern_methods!(
104        #[unsafe(method(init))]
105        #[unsafe(method_family = init)]
106        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
107
108        #[unsafe(method(new))]
109        #[unsafe(method_family = new)]
110        pub unsafe fn new() -> Retained<Self>;
111    );
112}