1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;

use crate::*;

extern "C" {
    #[cfg(all(feature = "NSError", feature = "NSString"))]
    pub static NSURLErrorDomain: &'static NSErrorDomain;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSURLErrorFailingURLErrorKey: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSURLErrorFailingURLStringErrorKey: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSErrorFailingURLStringKey: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSURLErrorFailingURLPeerTrustErrorKey: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSURLErrorBackgroundTaskCancelledReasonKey: &'static NSString;
}

pub const NSURLErrorCancelledReasonUserForceQuitApplication: NSInteger = 0;
pub const NSURLErrorCancelledReasonBackgroundUpdatesDisabled: NSInteger = 1;
pub const NSURLErrorCancelledReasonInsufficientSystemResources: NSInteger = 2;

extern "C" {
    #[cfg(all(feature = "NSError", feature = "NSString"))]
    pub static NSURLErrorNetworkUnavailableReasonKey: &'static NSErrorUserInfoKey;
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSURLErrorNetworkUnavailableReason(pub NSInteger);
impl NSURLErrorNetworkUnavailableReason {
    #[doc(alias = "NSURLErrorNetworkUnavailableReasonCellular")]
    pub const Cellular: Self = Self(0);
    #[doc(alias = "NSURLErrorNetworkUnavailableReasonExpensive")]
    pub const Expensive: Self = Self(1);
    #[doc(alias = "NSURLErrorNetworkUnavailableReasonConstrained")]
    pub const Constrained: Self = Self(2);
}

unsafe impl Encode for NSURLErrorNetworkUnavailableReason {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSURLErrorNetworkUnavailableReason {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

pub const NSURLErrorUnknown: NSInteger = -1;
pub const NSURLErrorCancelled: NSInteger = -999;
pub const NSURLErrorBadURL: NSInteger = -1000;
pub const NSURLErrorTimedOut: NSInteger = -1001;
pub const NSURLErrorUnsupportedURL: NSInteger = -1002;
pub const NSURLErrorCannotFindHost: NSInteger = -1003;
pub const NSURLErrorCannotConnectToHost: NSInteger = -1004;
pub const NSURLErrorNetworkConnectionLost: NSInteger = -1005;
pub const NSURLErrorDNSLookupFailed: NSInteger = -1006;
pub const NSURLErrorHTTPTooManyRedirects: NSInteger = -1007;
pub const NSURLErrorResourceUnavailable: NSInteger = -1008;
pub const NSURLErrorNotConnectedToInternet: NSInteger = -1009;
pub const NSURLErrorRedirectToNonExistentLocation: NSInteger = -1010;
pub const NSURLErrorBadServerResponse: NSInteger = -1011;
pub const NSURLErrorUserCancelledAuthentication: NSInteger = -1012;
pub const NSURLErrorUserAuthenticationRequired: NSInteger = -1013;
pub const NSURLErrorZeroByteResource: NSInteger = -1014;
pub const NSURLErrorCannotDecodeRawData: NSInteger = -1015;
pub const NSURLErrorCannotDecodeContentData: NSInteger = -1016;
pub const NSURLErrorCannotParseResponse: NSInteger = -1017;
pub const NSURLErrorAppTransportSecurityRequiresSecureConnection: NSInteger = -1022;
pub const NSURLErrorFileDoesNotExist: NSInteger = -1100;
pub const NSURLErrorFileIsDirectory: NSInteger = -1101;
pub const NSURLErrorNoPermissionsToReadFile: NSInteger = -1102;
pub const NSURLErrorDataLengthExceedsMaximum: NSInteger = -1103;
pub const NSURLErrorFileOutsideSafeArea: NSInteger = -1104;
pub const NSURLErrorSecureConnectionFailed: NSInteger = -1200;
pub const NSURLErrorServerCertificateHasBadDate: NSInteger = -1201;
pub const NSURLErrorServerCertificateUntrusted: NSInteger = -1202;
pub const NSURLErrorServerCertificateHasUnknownRoot: NSInteger = -1203;
pub const NSURLErrorServerCertificateNotYetValid: NSInteger = -1204;
pub const NSURLErrorClientCertificateRejected: NSInteger = -1205;
pub const NSURLErrorClientCertificateRequired: NSInteger = -1206;
pub const NSURLErrorCannotLoadFromNetwork: NSInteger = -2000;
pub const NSURLErrorCannotCreateFile: NSInteger = -3000;
pub const NSURLErrorCannotOpenFile: NSInteger = -3001;
pub const NSURLErrorCannotCloseFile: NSInteger = -3002;
pub const NSURLErrorCannotWriteToFile: NSInteger = -3003;
pub const NSURLErrorCannotRemoveFile: NSInteger = -3004;
pub const NSURLErrorCannotMoveFile: NSInteger = -3005;
pub const NSURLErrorDownloadDecodingFailedMidStream: NSInteger = -3006;
pub const NSURLErrorDownloadDecodingFailedToComplete: NSInteger = -3007;
pub const NSURLErrorInternationalRoamingOff: NSInteger = -1018;
pub const NSURLErrorCallIsActive: NSInteger = -1019;
pub const NSURLErrorDataNotAllowed: NSInteger = -1020;
pub const NSURLErrorRequestBodyStreamExhausted: NSInteger = -1021;
pub const NSURLErrorBackgroundSessionRequiresSharedContainer: NSInteger = -995;
pub const NSURLErrorBackgroundSessionInUseByAnotherProcess: NSInteger = -996;
pub const NSURLErrorBackgroundSessionWasDisconnected: NSInteger = -997;