objc2_core_data/generated/
NSPersistentStoreRequest.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/nspersistentstorerequesttype?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSPersistentStoreRequestType(pub NSUInteger);
15impl NSPersistentStoreRequestType {
16    #[doc(alias = "NSFetchRequestType")]
17    pub const FetchRequestType: Self = Self(1);
18    #[doc(alias = "NSSaveRequestType")]
19    pub const SaveRequestType: Self = Self(2);
20    #[doc(alias = "NSBatchInsertRequestType")]
21    pub const BatchInsertRequestType: Self = Self(5);
22    #[doc(alias = "NSBatchUpdateRequestType")]
23    pub const BatchUpdateRequestType: Self = Self(6);
24    #[doc(alias = "NSBatchDeleteRequestType")]
25    pub const BatchDeleteRequestType: Self = Self(7);
26}
27
28unsafe impl Encode for NSPersistentStoreRequestType {
29    const ENCODING: Encoding = NSUInteger::ENCODING;
30}
31
32unsafe impl RefEncode for NSPersistentStoreRequestType {
33    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36extern_class!(
37    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nspersistentstorerequest?language=objc)
38    #[unsafe(super(NSObject))]
39    #[derive(Debug, PartialEq, Eq, Hash)]
40    pub struct NSPersistentStoreRequest;
41);
42
43extern_conformance!(
44    unsafe impl NSCopying for NSPersistentStoreRequest {}
45);
46
47unsafe impl CopyingHelper for NSPersistentStoreRequest {
48    type Result = Self;
49}
50
51extern_conformance!(
52    unsafe impl NSObjectProtocol for NSPersistentStoreRequest {}
53);
54
55impl NSPersistentStoreRequest {
56    extern_methods!(
57        #[cfg(feature = "NSPersistentStore")]
58        #[unsafe(method(affectedStores))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn affectedStores(&self) -> Option<Retained<NSArray<NSPersistentStore>>>;
61
62        #[cfg(feature = "NSPersistentStore")]
63        /// Setter for [`affectedStores`][Self::affectedStores].
64        #[unsafe(method(setAffectedStores:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn setAffectedStores(
67            &self,
68            affected_stores: Option<&NSArray<NSPersistentStore>>,
69        );
70
71        #[unsafe(method(requestType))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn requestType(&self) -> NSPersistentStoreRequestType;
74    );
75}
76
77/// Methods declared on superclass `NSObject`.
78impl NSPersistentStoreRequest {
79    extern_methods!(
80        #[unsafe(method(init))]
81        #[unsafe(method_family = init)]
82        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
83
84        #[unsafe(method(new))]
85        #[unsafe(method_family = new)]
86        pub unsafe fn new() -> Retained<Self>;
87    );
88}