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
43unsafe impl NSCopying for NSPersistentStoreRequest {}
44
45unsafe impl CopyingHelper for NSPersistentStoreRequest {
46    type Result = Self;
47}
48
49unsafe impl NSObjectProtocol for NSPersistentStoreRequest {}
50
51impl NSPersistentStoreRequest {
52    extern_methods!(
53        #[cfg(feature = "NSPersistentStore")]
54        #[unsafe(method(affectedStores))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn affectedStores(&self) -> Option<Retained<NSArray<NSPersistentStore>>>;
57
58        #[cfg(feature = "NSPersistentStore")]
59        /// Setter for [`affectedStores`][Self::affectedStores].
60        #[unsafe(method(setAffectedStores:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn setAffectedStores(
63            &self,
64            affected_stores: Option<&NSArray<NSPersistentStore>>,
65        );
66
67        #[unsafe(method(requestType))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn requestType(&self) -> NSPersistentStoreRequestType;
70    );
71}
72
73/// Methods declared on superclass `NSObject`.
74impl NSPersistentStoreRequest {
75    extern_methods!(
76        #[unsafe(method(init))]
77        #[unsafe(method_family = init)]
78        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
79
80        #[unsafe(method(new))]
81        #[unsafe(method_family = new)]
82        pub unsafe fn new() -> Retained<Self>;
83    );
84}