use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSPersistentStoreRequestType(pub NSUInteger);
impl NSPersistentStoreRequestType {
#[doc(alias = "NSFetchRequestType")]
pub const FetchRequestType: Self = Self(1);
#[doc(alias = "NSSaveRequestType")]
pub const SaveRequestType: Self = Self(2);
#[doc(alias = "NSBatchInsertRequestType")]
pub const BatchInsertRequestType: Self = Self(5);
#[doc(alias = "NSBatchUpdateRequestType")]
pub const BatchUpdateRequestType: Self = Self(6);
#[doc(alias = "NSBatchDeleteRequestType")]
pub const BatchDeleteRequestType: Self = Self(7);
}
unsafe impl Encode for NSPersistentStoreRequestType {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSPersistentStoreRequestType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSPersistentStoreRequest;
);
extern_conformance!(
unsafe impl NSCopying for NSPersistentStoreRequest {}
);
unsafe impl CopyingHelper for NSPersistentStoreRequest {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSPersistentStoreRequest {}
);
impl NSPersistentStoreRequest {
extern_methods!(
#[cfg(feature = "NSPersistentStore")]
#[unsafe(method(affectedStores))]
#[unsafe(method_family = none)]
pub unsafe fn affectedStores(&self) -> Option<Retained<NSArray<NSPersistentStore>>>;
#[cfg(feature = "NSPersistentStore")]
#[unsafe(method(setAffectedStores:))]
#[unsafe(method_family = none)]
pub unsafe fn setAffectedStores(
&self,
affected_stores: Option<&NSArray<NSPersistentStore>>,
);
#[unsafe(method(requestType))]
#[unsafe(method_family = none)]
pub unsafe fn requestType(&self) -> NSPersistentStoreRequestType;
);
}
impl NSPersistentStoreRequest {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}