use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSPersistentStore;
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSPersistentStore {}
);
impl NSPersistentStore {
extern_methods!(
#[unsafe(method(metadataForPersistentStoreWithURL:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn metadataForPersistentStoreWithURL_error(
url: &NSURL,
) -> Result<Retained<NSDictionary<NSString, AnyObject>>, Retained<NSError>>;
#[unsafe(method(setMetadata:forPersistentStoreWithURL:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn setMetadata_forPersistentStoreWithURL_error(
metadata: Option<&NSDictionary<NSString, AnyObject>>,
url: &NSURL,
) -> Result<(), Retained<NSError>>;
#[unsafe(method(migrationManagerClass))]
#[unsafe(method_family = none)]
pub unsafe fn migrationManagerClass() -> &'static AnyClass;
#[cfg(feature = "NSPersistentStoreCoordinator")]
#[unsafe(method(initWithPersistentStoreCoordinator:configurationName:URL:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithPersistentStoreCoordinator_configurationName_URL_options(
this: Allocated<Self>,
root: Option<&NSPersistentStoreCoordinator>,
name: Option<&NSString>,
url: &NSURL,
options: Option<&NSDictionary>,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(loadMetadata:_))]
#[unsafe(method_family = none)]
pub unsafe fn loadMetadata(&self) -> Result<(), Retained<NSError>>;
#[cfg(feature = "NSPersistentStoreCoordinator")]
#[unsafe(method(persistentStoreCoordinator))]
#[unsafe(method_family = none)]
pub unsafe fn persistentStoreCoordinator(
&self,
) -> Option<Retained<NSPersistentStoreCoordinator>>;
#[unsafe(method(configurationName))]
#[unsafe(method_family = none)]
pub unsafe fn configurationName(&self) -> Retained<NSString>;
#[unsafe(method(options))]
#[unsafe(method_family = none)]
pub unsafe fn options(&self) -> Option<Retained<NSDictionary>>;
#[unsafe(method(URL))]
#[unsafe(method_family = none)]
pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
#[unsafe(method(setURL:))]
#[unsafe(method_family = none)]
pub unsafe fn setURL(&self, url: Option<&NSURL>);
#[unsafe(method(identifier))]
#[unsafe(method_family = none)]
pub unsafe fn identifier(&self) -> Retained<NSString>;
#[unsafe(method(setIdentifier:))]
#[unsafe(method_family = none)]
pub unsafe fn setIdentifier(&self, identifier: Option<&NSString>);
#[unsafe(method(type))]
#[unsafe(method_family = none)]
pub unsafe fn r#type(&self) -> Retained<NSString>;
#[unsafe(method(isReadOnly))]
#[unsafe(method_family = none)]
pub unsafe fn isReadOnly(&self) -> bool;
#[unsafe(method(setReadOnly:))]
#[unsafe(method_family = none)]
pub unsafe fn setReadOnly(&self, read_only: bool);
#[unsafe(method(metadata))]
#[unsafe(method_family = none)]
pub unsafe fn metadata(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
#[unsafe(method(setMetadata:))]
#[unsafe(method_family = none)]
pub unsafe fn setMetadata(&self, metadata: Option<&NSDictionary<NSString, AnyObject>>);
#[cfg(feature = "NSPersistentStoreCoordinator")]
#[unsafe(method(didAddToPersistentStoreCoordinator:))]
#[unsafe(method_family = none)]
pub unsafe fn didAddToPersistentStoreCoordinator(
&self,
coordinator: &NSPersistentStoreCoordinator,
);
#[cfg(feature = "NSPersistentStoreCoordinator")]
#[unsafe(method(willRemoveFromPersistentStoreCoordinator:))]
#[unsafe(method_family = none)]
pub unsafe fn willRemoveFromPersistentStoreCoordinator(
&self,
coordinator: Option<&NSPersistentStoreCoordinator>,
);
#[cfg(feature = "NSCoreDataCoreSpotlightDelegate")]
#[unsafe(method(coreSpotlightExporter))]
#[unsafe(method_family = none)]
pub unsafe fn coreSpotlightExporter(&self) -> Retained<NSCoreDataCoreSpotlightDelegate>;
);
}
impl NSPersistentStore {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}