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