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