objc2_foundation/generated/NSURLError.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::*;
5
6use crate::*;
7
8extern "C" {
9 /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrordomain?language=objc)
10 #[cfg(all(feature = "NSError", feature = "NSString"))]
11 pub static NSURLErrorDomain: &'static NSErrorDomain;
12}
13
14extern "C" {
15 /// The NSError userInfo dictionary key used to store and retrieve the URL which caused a load to fail.
16 ///
17 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorfailingurlerrorkey?language=objc)
18 #[cfg(feature = "NSString")]
19 pub static NSURLErrorFailingURLErrorKey: &'static NSString;
20}
21
22extern "C" {
23 /// The NSError userInfo dictionary key used to store and retrieve the NSString object for the URL which caused a load to fail.
24 ///
25 /// This constant supersedes NSErrorFailingURLStringKey, which was deprecated in Mac OS X 10.6. Both constants refer to the same value for backward-compatibility, but this symbol name has a better prefix.
26 ///
27 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorfailingurlstringerrorkey?language=objc)
28 #[cfg(feature = "NSString")]
29 #[deprecated = "Use NSURLErrorFailingURLErrorKey instead"]
30 pub static NSURLErrorFailingURLStringErrorKey: &'static NSString;
31}
32
33extern "C" {
34 /// The NSError userInfo dictionary key used to store and retrieve the NSString object for the URL which caused a load to fail.
35 ///
36 /// This constant is deprecated in Mac OS X 10.6, and is superseded by NSURLErrorFailingURLStringErrorKey. Both constants refer to the same value for backward-compatibility, but the new symbol name has a better prefix.
37 ///
38 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nserrorfailingurlstringkey?language=objc)
39 #[cfg(feature = "NSString")]
40 #[deprecated = "Use NSURLErrorFailingURLErrorKey instead"]
41 pub static NSErrorFailingURLStringKey: &'static NSString;
42}
43
44extern "C" {
45 /// The NSError userInfo dictionary key used to store and retrieve the SecTrustRef object representing the state of a failed SSL handshake.
46 ///
47 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorfailingurlpeertrusterrorkey?language=objc)
48 #[cfg(feature = "NSString")]
49 pub static NSURLErrorFailingURLPeerTrustErrorKey: &'static NSString;
50}
51
52extern "C" {
53 /// The NSError userInfo dictionary key used to store and retrieve the NSNumber corresponding to the reason why a background
54 /// NSURLSessionTask was cancelled
55 ///
56 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorbackgroundtaskcancelledreasonkey?language=objc)
57 #[cfg(feature = "NSString")]
58 pub static NSURLErrorBackgroundTaskCancelledReasonKey: &'static NSString;
59}
60
61/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcancelledreasonuserforcequitapplication?language=objc)
62pub const NSURLErrorCancelledReasonUserForceQuitApplication: NSInteger = 0;
63/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcancelledreasonbackgroundupdatesdisabled?language=objc)
64pub const NSURLErrorCancelledReasonBackgroundUpdatesDisabled: NSInteger = 1;
65/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcancelledreasoninsufficientsystemresources?language=objc)
66pub const NSURLErrorCancelledReasonInsufficientSystemResources: NSInteger = 2;
67
68extern "C" {
69 /// The NSErrorUserInfoKey used to store and retrieve the NSNumber object corresponding to the reason why the network is unavailable when the task failed due to unsatisfiable network constraints. See the NSURLErrorNetworkUnavailableReason enum for details.
70 ///
71 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrornetworkunavailablereasonkey?language=objc)
72 #[cfg(all(feature = "NSError", feature = "NSString"))]
73 pub static NSURLErrorNetworkUnavailableReasonKey: &'static NSErrorUserInfoKey;
74}
75
76/// Constants used by NSError to indicate that a URLSessionTask failed because of unsatisfiable network constraints.
77///
78/// For example if the URLSessionConfiguration property allowsExpensiveNetworkAccess was set to NO and the only interfaces available were marked as expensive then the task would fail with a NSURLErrorNotConnectedToInternet error and the userInfo dictionary would contain the value NSURLErrorNetworkUnavailableReasonExpensive for the key NSURLErrorNetworkUnavailableReason.
79///
80/// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrornetworkunavailablereason?language=objc)
81// NS_ENUM
82#[repr(transparent)]
83#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
84pub struct NSURLErrorNetworkUnavailableReason(pub NSInteger);
85impl NSURLErrorNetworkUnavailableReason {
86 #[doc(alias = "NSURLErrorNetworkUnavailableReasonCellular")]
87 pub const Cellular: Self = Self(0);
88 #[doc(alias = "NSURLErrorNetworkUnavailableReasonExpensive")]
89 pub const Expensive: Self = Self(1);
90 #[doc(alias = "NSURLErrorNetworkUnavailableReasonConstrained")]
91 pub const Constrained: Self = Self(2);
92}
93
94unsafe impl Encode for NSURLErrorNetworkUnavailableReason {
95 const ENCODING: Encoding = NSInteger::ENCODING;
96}
97
98unsafe impl RefEncode for NSURLErrorNetworkUnavailableReason {
99 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
100}
101
102/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorunknown?language=objc)
103pub const NSURLErrorUnknown: NSInteger = -1;
104/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcancelled?language=objc)
105pub const NSURLErrorCancelled: NSInteger = -999;
106/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorbadurl?language=objc)
107pub const NSURLErrorBadURL: NSInteger = -1000;
108/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrortimedout?language=objc)
109pub const NSURLErrorTimedOut: NSInteger = -1001;
110/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorunsupportedurl?language=objc)
111pub const NSURLErrorUnsupportedURL: NSInteger = -1002;
112/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcannotfindhost?language=objc)
113pub const NSURLErrorCannotFindHost: NSInteger = -1003;
114/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcannotconnecttohost?language=objc)
115pub const NSURLErrorCannotConnectToHost: NSInteger = -1004;
116/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrornetworkconnectionlost?language=objc)
117pub const NSURLErrorNetworkConnectionLost: NSInteger = -1005;
118/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrordnslookupfailed?language=objc)
119pub const NSURLErrorDNSLookupFailed: NSInteger = -1006;
120/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorhttptoomanyredirects?language=objc)
121pub const NSURLErrorHTTPTooManyRedirects: NSInteger = -1007;
122/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorresourceunavailable?language=objc)
123pub const NSURLErrorResourceUnavailable: NSInteger = -1008;
124/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrornotconnectedtointernet?language=objc)
125pub const NSURLErrorNotConnectedToInternet: NSInteger = -1009;
126/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorredirecttononexistentlocation?language=objc)
127pub const NSURLErrorRedirectToNonExistentLocation: NSInteger = -1010;
128/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorbadserverresponse?language=objc)
129pub const NSURLErrorBadServerResponse: NSInteger = -1011;
130/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorusercancelledauthentication?language=objc)
131pub const NSURLErrorUserCancelledAuthentication: NSInteger = -1012;
132/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerroruserauthenticationrequired?language=objc)
133pub const NSURLErrorUserAuthenticationRequired: NSInteger = -1013;
134/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorzerobyteresource?language=objc)
135pub const NSURLErrorZeroByteResource: NSInteger = -1014;
136/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcannotdecoderawdata?language=objc)
137pub const NSURLErrorCannotDecodeRawData: NSInteger = -1015;
138/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcannotdecodecontentdata?language=objc)
139pub const NSURLErrorCannotDecodeContentData: NSInteger = -1016;
140/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcannotparseresponse?language=objc)
141pub const NSURLErrorCannotParseResponse: NSInteger = -1017;
142/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorapptransportsecurityrequiressecureconnection?language=objc)
143pub const NSURLErrorAppTransportSecurityRequiresSecureConnection: NSInteger = -1022;
144/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorfiledoesnotexist?language=objc)
145pub const NSURLErrorFileDoesNotExist: NSInteger = -1100;
146/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorfileisdirectory?language=objc)
147pub const NSURLErrorFileIsDirectory: NSInteger = -1101;
148/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrornopermissionstoreadfile?language=objc)
149pub const NSURLErrorNoPermissionsToReadFile: NSInteger = -1102;
150/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrordatalengthexceedsmaximum?language=objc)
151pub const NSURLErrorDataLengthExceedsMaximum: NSInteger = -1103;
152/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorfileoutsidesafearea?language=objc)
153pub const NSURLErrorFileOutsideSafeArea: NSInteger = -1104;
154/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorsecureconnectionfailed?language=objc)
155pub const NSURLErrorSecureConnectionFailed: NSInteger = -1200;
156/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorservercertificatehasbaddate?language=objc)
157pub const NSURLErrorServerCertificateHasBadDate: NSInteger = -1201;
158/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorservercertificateuntrusted?language=objc)
159pub const NSURLErrorServerCertificateUntrusted: NSInteger = -1202;
160/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorservercertificatehasunknownroot?language=objc)
161pub const NSURLErrorServerCertificateHasUnknownRoot: NSInteger = -1203;
162/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorservercertificatenotyetvalid?language=objc)
163pub const NSURLErrorServerCertificateNotYetValid: NSInteger = -1204;
164/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorclientcertificaterejected?language=objc)
165pub const NSURLErrorClientCertificateRejected: NSInteger = -1205;
166/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorclientcertificaterequired?language=objc)
167pub const NSURLErrorClientCertificateRequired: NSInteger = -1206;
168/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcannotloadfromnetwork?language=objc)
169pub const NSURLErrorCannotLoadFromNetwork: NSInteger = -2000;
170/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcannotcreatefile?language=objc)
171pub const NSURLErrorCannotCreateFile: NSInteger = -3000;
172/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcannotopenfile?language=objc)
173pub const NSURLErrorCannotOpenFile: NSInteger = -3001;
174/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcannotclosefile?language=objc)
175pub const NSURLErrorCannotCloseFile: NSInteger = -3002;
176/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcannotwritetofile?language=objc)
177pub const NSURLErrorCannotWriteToFile: NSInteger = -3003;
178/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcannotremovefile?language=objc)
179pub const NSURLErrorCannotRemoveFile: NSInteger = -3004;
180/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcannotmovefile?language=objc)
181pub const NSURLErrorCannotMoveFile: NSInteger = -3005;
182/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrordownloaddecodingfailedmidstream?language=objc)
183pub const NSURLErrorDownloadDecodingFailedMidStream: NSInteger = -3006;
184/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrordownloaddecodingfailedtocomplete?language=objc)
185pub const NSURLErrorDownloadDecodingFailedToComplete: NSInteger = -3007;
186/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorinternationalroamingoff?language=objc)
187pub const NSURLErrorInternationalRoamingOff: NSInteger = -1018;
188/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorcallisactive?language=objc)
189pub const NSURLErrorCallIsActive: NSInteger = -1019;
190/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrordatanotallowed?language=objc)
191pub const NSURLErrorDataNotAllowed: NSInteger = -1020;
192/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorrequestbodystreamexhausted?language=objc)
193pub const NSURLErrorRequestBodyStreamExhausted: NSInteger = -1021;
194/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorbackgroundsessionrequiressharedcontainer?language=objc)
195pub const NSURLErrorBackgroundSessionRequiresSharedContainer: NSInteger = -995;
196/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorbackgroundsessioninusebyanotherprocess?language=objc)
197pub const NSURLErrorBackgroundSessionInUseByAnotherProcess: NSInteger = -996;
198/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlerrorbackgroundsessionwasdisconnected?language=objc)
199pub const NSURLErrorBackgroundSessionWasDisconnected: NSInteger = -997;