objc2_file_provider/generated/
NSFileProviderError.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern "C" {
10    /// [Apple's documentation](https://developer.apple.com/documentation/fileprovider/nsfileprovidererrordomain?language=objc)
11    pub static NSFileProviderErrorDomain: &'static NSErrorDomain;
12}
13
14extern "C" {
15    /// [Apple's documentation](https://developer.apple.com/documentation/fileprovider/nsfileprovidererrorcollidingitemkey?language=objc)
16    pub static NSFileProviderErrorCollidingItemKey: &'static NSErrorUserInfoKey;
17}
18
19extern "C" {
20    /// [Apple's documentation](https://developer.apple.com/documentation/fileprovider/nsfileprovidererroritemkey?language=objc)
21    pub static NSFileProviderErrorItemKey: &'static NSErrorUserInfoKey;
22}
23
24extern "C" {
25    /// [Apple's documentation](https://developer.apple.com/documentation/fileprovider/nsfileprovidererrornonexistentitemidentifierkey?language=objc)
26    pub static NSFileProviderErrorNonExistentItemIdentifierKey: &'static NSErrorUserInfoKey;
27}
28
29/// [Apple's documentation](https://developer.apple.com/documentation/fileprovider/nsfileprovidererrorcode?language=objc)
30// NS_ERROR_ENUM
31#[repr(transparent)]
32#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
33pub struct NSFileProviderErrorCode(pub NSInteger);
34impl NSFileProviderErrorCode {
35    /// The user credentials cannot be verified
36    #[doc(alias = "NSFileProviderErrorNotAuthenticated")]
37    pub const NotAuthenticated: Self = Self(-1000);
38    /// An item already exists with the same parentItemIdentifier and filename (or with a filename differing only in case.)
39    ///
40    ///
41    /// Note: Please use -[NSError (NSFileProviderError) fileProviderErrorForCollisionWithItem:] to build an error with this code.
42    ///
43    /// See: -[NSError (NSFileProviderError) fileProviderErrorForCollisionWithItem:]
44    #[doc(alias = "NSFileProviderErrorFilenameCollision")]
45    pub const FilenameCollision: Self = Self(-1001);
46    /// The value of the sync anchor is too old, and the system must re-sync from scratch
47    #[doc(alias = "NSFileProviderErrorSyncAnchorExpired")]
48    pub const SyncAnchorExpired: Self = Self(-1002);
49    /// The value of the page token is too old, and the system must re-sync from scratch
50    #[doc(alias = "NSFileProviderErrorPageExpired")]
51    pub const PageExpired: Self = Self(NSFileProviderErrorCode::SyncAnchorExpired.0);
52    /// The item has not been uploaded because it would push the account over quota
53    #[doc(alias = "NSFileProviderErrorInsufficientQuota")]
54    pub const InsufficientQuota: Self = Self(-1003);
55    /// Connecting to the servers failed
56    #[doc(alias = "NSFileProviderErrorServerUnreachable")]
57    pub const ServerUnreachable: Self = Self(-1004);
58    /// The requested item doesn't exist
59    ///
60    ///
61    /// Note: Please use -[NSError (NSFileProviderError) fileProviderErrorForNonExistentItemWithIdentifier:] to build an error with this code.
62    ///
63    /// See: -[NSError (NSFileProviderError) fileProviderErrorForNonExistentItemWithIdentifier:]
64    #[doc(alias = "NSFileProviderErrorNoSuchItem")]
65    pub const NoSuchItem: Self = Self(-1005);
66    /// The provider disallowed the deletion of the item.
67    ///
68    ///
69    /// Note: Please use -[NSError (NSFileProviderError) fileProviderErrorForRejectedDeletionOfItem:] to build an error with this code.
70    ///
71    /// See: -[NSError (NSFileProviderError) fileProviderErrorForRejectedDeletionOfItem:]
72    #[doc(alias = "NSFileProviderErrorDeletionRejected")]
73    pub const DeletionRejected: Self = Self(-1006);
74    /// We're trying to non-recursively delete a non-empty directory
75    #[doc(alias = "NSFileProviderErrorDirectoryNotEmpty")]
76    pub const DirectoryNotEmpty: Self = Self(-1007);
77    /// Returned by NSFileProviderManager if no provider could be found in the application
78    #[doc(alias = "NSFileProviderErrorProviderNotFound")]
79    pub const ProviderNotFound: Self = Self(-2001);
80    /// Returned by NSFileProviderManager if the application's provider has been disabled due to app translocation
81    #[doc(alias = "NSFileProviderErrorProviderTranslocated")]
82    pub const ProviderTranslocated: Self = Self(-2002);
83    /// Returned by NSFileProviderManager if the provider registered in the system is an older version than the one corresponding to this app.
84    /// The `NSFilePathErrorKey` key points to the location of the older version. If the location of the older version cannot be determined (e.g. because it was since deleted), the `NSFilePathErrorKey` will not be set.
85    #[doc(alias = "NSFileProviderErrorOlderExtensionVersionRunning")]
86    pub const OlderExtensionVersionRunning: Self = Self(-2003);
87    /// Returned by NSFileProviderManager if the provider registered in the system is a newer version than the one corresponding to this app.
88    #[doc(alias = "NSFileProviderErrorNewerExtensionVersionFound")]
89    pub const NewerExtensionVersionFound: Self = Self(-2004);
90    /// Indicates that synchronization cannot happen.
91    ///
92    /// This error can be returned by the provider or the system.
93    ///
94    /// This is returned by NSFileProviderManager if a barrier failed for a sync-related error.
95    ///
96    /// If the failure is caused by a specific item, the system will set the NSFileProviderErrorItemKey to the corresponding item identifier
97    /// and the NSUnderlyingErrorKey will be set to the error encountered by that item.
98    ///
99    /// When a provider returns this error on createItem or updateItem, it means that syncing that item is definitively broken.
100    /// The system will not retry syncing those items, until either:
101    /// The operating system has been updated.
102    /// The FileProvider extension has been updated.
103    /// The item is modified on disk.
104    #[doc(alias = "NSFileProviderErrorCannotSynchronize")]
105    pub const CannotSynchronize: Self = Self(-2005);
106    /// Returned by NSFileProviderManager if directory eviction failed because the target contains non-evictable items.
107    ///
108    /// -[NSError underlyingErrors] is set to an array of the underlying errors. Each one has NSURLErrorKey set
109    /// to identify the particular file or directory affected by this error. The number of reported failing items is capped to an
110    /// implementation-defined number.
111    ///
112    /// + domain: NSFileProviderErrorDomain errorCode: NSFileProviderErrorUnsyncedEdits error: if the item had unsynced content.
113    /// + domain: NSFileProviderErrorDomain errorCode: NSFileProviderErrorNonEvictable error: if the item has been marked as non-purgeable by the provider.
114    /// + domain: NSPOSIXErrorDomain errorCode: EBUSY - if the item had open file descriptors on it.
115    /// + domain: NSPOSIXErrorDomain errorCode: EMLINK : if the item had several hardlinks.
116    #[doc(alias = "NSFileProviderErrorNonEvictableChildren")]
117    pub const NonEvictableChildren: Self = Self(-2006);
118    /// Returned by NSFileProviderManager if item eviction is failing because the item has edits that have not been synced yet
119    ///
120    /// The NSURLErrorKey will be set to with the item URL that has unsynced content.
121    #[doc(alias = "NSFileProviderErrorUnsyncedEdits")]
122    pub const UnsyncedEdits: Self = Self(-2007);
123    /// Returned by NSFileProviderManager if item eviction is failing because the item has not been assigned the evictable capability.
124    ///
125    /// The NSURLErrorKey will be set to with the corresponding item URL.
126    #[doc(alias = "NSFileProviderErrorNonEvictable")]
127    pub const NonEvictable: Self = Self(-2008);
128    /// Returned by the provider to indicate that the requested version for an item cannot be provided.
129    ///
130    /// When a provider returns that error, it means the version for this item is definitively unavailable. It is intended to be returned by
131    /// fetchPartialContentsForItemWithIdentifier, when NSFileProviderFetchContentsOptionsStrictVersioning is set, to tell the system that a remote update
132    /// happened to the item that outdated the requested version.
133    #[doc(alias = "NSFileProviderErrorVersionNoLongerAvailable")]
134    pub const VersionNoLongerAvailable: Self = Self(-2009);
135    /// Returned by createItemBasedOnTemplate or modifyItem if the provider does not wish to sync the item.
136    ///
137    /// When a provider returns this error, it causes the item to be excluded from sync. The system will ensure that
138    /// the item (and any descendents, in case of a directory), are downloaded, and then issue a deleteItem call to the
139    /// provider for the item.
140    ///
141    /// The system will call createItemBasedOnTemplate for the item, whenever the item's metadata changes on disk.
142    /// This ensures that the provider's rules for excluding from sync are re-evaluated whenever the
143    /// item's properties change.
144    ///
145    /// Re-evaluating items
146    /// ------
147    ///
148    /// If the provider wishes for previously excluded items to be re-sent as createItemBasedOnTemplate calls,
149    /// the provider may call -[NSFileProviderManager signalErrorResolved:completionHandler:] with this error code.
150    ///
151    /// If the provider wishes to exclude items which had previously been synced, the provider may call
152    /// -[NSFileProviderManager requestModificationOfFields:forItemWithIdentifier:options:completionHandler:].
153    /// This will cause the system to send a new modifyItem call to the provider. At that time, the provider can choose to
154    /// return this error code.
155    #[doc(alias = "NSFileProviderErrorExcludedFromSync")]
156    pub const ExcludedFromSync: Self = Self(-2010);
157    /// Returned by createItemBasedOnTemplate or modifyItem if the provider does not wish to sync the item.
158    ///
159    /// When a provider returns this error, it causes the item to be excluded from sync. The system will ensure that
160    /// the item (and any descendents, in case of a directory), are downloaded, and then issue a deleteItem call to the
161    /// provider for the item.
162    ///
163    /// The system will call createItemBasedOnTemplate for the item, whenever the item's metadata changes on disk.
164    /// This ensures that the provider's rules for excluding from sync are re-evaluated whenever the
165    /// item's properties change.
166    ///
167    /// Re-evaluating items
168    /// ------
169    ///
170    /// If the provider wishes for previously excluded items to be re-sent as createItemBasedOnTemplate calls,
171    /// the provider may call -[NSFileProviderManager signalErrorResolved:completionHandler:] with this error code.
172    ///
173    /// If the provider wishes to exclude items which had previously been synced, the provider may call
174    /// -[NSFileProviderManager requestModificationOfFields:forItemWithIdentifier:options:completionHandler:].
175    /// This will cause the system to send a new modifyItem call to the provider. At that time, the provider can choose to
176    /// return this error code.
177    #[doc(alias = "NSFileProviderErrorDomainDisabled")]
178    pub const DomainDisabled: Self = Self(-2011);
179    /// Returned by createItemBasedOnTemplate or modifyItem if the provider does not wish to sync the item.
180    ///
181    /// When a provider returns this error, it causes the item to be excluded from sync. The system will ensure that
182    /// the item (and any descendents, in case of a directory), are downloaded, and then issue a deleteItem call to the
183    /// provider for the item.
184    ///
185    /// The system will call createItemBasedOnTemplate for the item, whenever the item's metadata changes on disk.
186    /// This ensures that the provider's rules for excluding from sync are re-evaluated whenever the
187    /// item's properties change.
188    ///
189    /// Re-evaluating items
190    /// ------
191    ///
192    /// If the provider wishes for previously excluded items to be re-sent as createItemBasedOnTemplate calls,
193    /// the provider may call -[NSFileProviderManager signalErrorResolved:completionHandler:] with this error code.
194    ///
195    /// If the provider wishes to exclude items which had previously been synced, the provider may call
196    /// -[NSFileProviderManager requestModificationOfFields:forItemWithIdentifier:options:completionHandler:].
197    /// This will cause the system to send a new modifyItem call to the provider. At that time, the provider can choose to
198    /// return this error code.
199    #[doc(alias = "NSFileProviderErrorProviderDomainTemporarilyUnavailable")]
200    pub const ProviderDomainTemporarilyUnavailable: Self = Self(-2012);
201    /// Returned by createItemBasedOnTemplate or modifyItem if the provider does not wish to sync the item.
202    ///
203    /// When a provider returns this error, it causes the item to be excluded from sync. The system will ensure that
204    /// the item (and any descendents, in case of a directory), are downloaded, and then issue a deleteItem call to the
205    /// provider for the item.
206    ///
207    /// The system will call createItemBasedOnTemplate for the item, whenever the item's metadata changes on disk.
208    /// This ensures that the provider's rules for excluding from sync are re-evaluated whenever the
209    /// item's properties change.
210    ///
211    /// Re-evaluating items
212    /// ------
213    ///
214    /// If the provider wishes for previously excluded items to be re-sent as createItemBasedOnTemplate calls,
215    /// the provider may call -[NSFileProviderManager signalErrorResolved:completionHandler:] with this error code.
216    ///
217    /// If the provider wishes to exclude items which had previously been synced, the provider may call
218    /// -[NSFileProviderManager requestModificationOfFields:forItemWithIdentifier:options:completionHandler:].
219    /// This will cause the system to send a new modifyItem call to the provider. At that time, the provider can choose to
220    /// return this error code.
221    #[doc(alias = "NSFileProviderErrorProviderDomainNotFound")]
222    pub const ProviderDomainNotFound: Self = Self(-2013);
223    /// Returned by createItemBasedOnTemplate or modifyItem if the provider does not wish to sync the item.
224    ///
225    /// When a provider returns this error, it causes the item to be excluded from sync. The system will ensure that
226    /// the item (and any descendents, in case of a directory), are downloaded, and then issue a deleteItem call to the
227    /// provider for the item.
228    ///
229    /// The system will call createItemBasedOnTemplate for the item, whenever the item's metadata changes on disk.
230    /// This ensures that the provider's rules for excluding from sync are re-evaluated whenever the
231    /// item's properties change.
232    ///
233    /// Re-evaluating items
234    /// ------
235    ///
236    /// If the provider wishes for previously excluded items to be re-sent as createItemBasedOnTemplate calls,
237    /// the provider may call -[NSFileProviderManager signalErrorResolved:completionHandler:] with this error code.
238    ///
239    /// If the provider wishes to exclude items which had previously been synced, the provider may call
240    /// -[NSFileProviderManager requestModificationOfFields:forItemWithIdentifier:options:completionHandler:].
241    /// This will cause the system to send a new modifyItem call to the provider. At that time, the provider can choose to
242    /// return this error code.
243    #[doc(alias = "NSFileProviderErrorApplicationExtensionNotFound")]
244    pub const ApplicationExtensionNotFound: Self = Self(-2014);
245}
246
247unsafe impl Encode for NSFileProviderErrorCode {
248    const ENCODING: Encoding = NSInteger::ENCODING;
249}
250
251unsafe impl RefEncode for NSFileProviderErrorCode {
252    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
253}
254
255mod private_NSErrorNSFileProviderError {
256    pub trait Sealed {}
257}
258
259/// Category "NSFileProviderError" on [`NSError`].
260#[doc(alias = "NSFileProviderError")]
261pub unsafe trait NSErrorNSFileProviderError:
262    ClassType + Sized + private_NSErrorNSFileProviderError::Sealed
263{
264    extern_methods!(
265        #[cfg(feature = "NSFileProviderItem")]
266        #[unsafe(method(fileProviderErrorForCollisionWithItem:))]
267        #[unsafe(method_family = none)]
268        unsafe fn fileProviderErrorForCollisionWithItem(
269            existing_item: &NSFileProviderItem,
270        ) -> Retained<Self>;
271
272        #[cfg(feature = "NSFileProviderItem")]
273        #[unsafe(method(fileProviderErrorForNonExistentItemWithIdentifier:))]
274        #[unsafe(method_family = none)]
275        unsafe fn fileProviderErrorForNonExistentItemWithIdentifier(
276            item_identifier: &NSFileProviderItemIdentifier,
277        ) -> Retained<Self>;
278
279        #[cfg(feature = "NSFileProviderItem")]
280        #[unsafe(method(fileProviderErrorForRejectedDeletionOfItem:))]
281        #[unsafe(method_family = none)]
282        unsafe fn fileProviderErrorForRejectedDeletionOfItem(
283            updated_version: &NSFileProviderItem,
284        ) -> Retained<Self>;
285    );
286}
287
288impl private_NSErrorNSFileProviderError::Sealed for NSError {}
289unsafe impl NSErrorNSFileProviderError for NSError {}