icrate/generated/Foundation/
NSURLResponse.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use crate::common::*;
4use crate::Foundation::*;
5
6extern_class!(
7    #[derive(Debug, PartialEq, Eq, Hash)]
8    #[cfg(feature = "Foundation_NSURLResponse")]
9    pub struct NSURLResponse;
10
11    #[cfg(feature = "Foundation_NSURLResponse")]
12    unsafe impl ClassType for NSURLResponse {
13        type Super = NSObject;
14        type Mutability = InteriorMutable;
15    }
16);
17
18#[cfg(feature = "Foundation_NSURLResponse")]
19unsafe impl Send for NSURLResponse {}
20
21#[cfg(feature = "Foundation_NSURLResponse")]
22unsafe impl Sync for NSURLResponse {}
23
24#[cfg(feature = "Foundation_NSURLResponse")]
25unsafe impl NSCoding for NSURLResponse {}
26
27#[cfg(feature = "Foundation_NSURLResponse")]
28unsafe impl NSCopying for NSURLResponse {}
29
30#[cfg(feature = "Foundation_NSURLResponse")]
31unsafe impl NSObjectProtocol for NSURLResponse {}
32
33#[cfg(feature = "Foundation_NSURLResponse")]
34unsafe impl NSSecureCoding for NSURLResponse {}
35
36extern_methods!(
37    #[cfg(feature = "Foundation_NSURLResponse")]
38    unsafe impl NSURLResponse {
39        #[cfg(all(feature = "Foundation_NSString", feature = "Foundation_NSURL"))]
40        #[method_id(@__retain_semantics Init initWithURL:MIMEType:expectedContentLength:textEncodingName:)]
41        pub unsafe fn initWithURL_MIMEType_expectedContentLength_textEncodingName(
42            this: Allocated<Self>,
43            url: &NSURL,
44            mime_type: Option<&NSString>,
45            length: NSInteger,
46            name: Option<&NSString>,
47        ) -> Id<Self>;
48
49        #[cfg(feature = "Foundation_NSURL")]
50        #[method_id(@__retain_semantics Other URL)]
51        pub unsafe fn URL(&self) -> Option<Id<NSURL>>;
52
53        #[cfg(feature = "Foundation_NSString")]
54        #[method_id(@__retain_semantics Other MIMEType)]
55        pub unsafe fn MIMEType(&self) -> Option<Id<NSString>>;
56
57        #[method(expectedContentLength)]
58        pub unsafe fn expectedContentLength(&self) -> c_longlong;
59
60        #[cfg(feature = "Foundation_NSString")]
61        #[method_id(@__retain_semantics Other textEncodingName)]
62        pub unsafe fn textEncodingName(&self) -> Option<Id<NSString>>;
63
64        #[cfg(feature = "Foundation_NSString")]
65        #[method_id(@__retain_semantics Other suggestedFilename)]
66        pub unsafe fn suggestedFilename(&self) -> Option<Id<NSString>>;
67    }
68);
69
70extern_methods!(
71    /// Methods declared on superclass `NSObject`
72    #[cfg(feature = "Foundation_NSURLResponse")]
73    unsafe impl NSURLResponse {
74        #[method_id(@__retain_semantics Init init)]
75        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
76
77        #[method_id(@__retain_semantics New new)]
78        pub unsafe fn new() -> Id<Self>;
79    }
80);
81
82extern_class!(
83    #[derive(Debug, PartialEq, Eq, Hash)]
84    #[cfg(feature = "Foundation_NSHTTPURLResponse")]
85    pub struct NSHTTPURLResponse;
86
87    #[cfg(feature = "Foundation_NSHTTPURLResponse")]
88    unsafe impl ClassType for NSHTTPURLResponse {
89        #[inherits(NSObject)]
90        type Super = NSURLResponse;
91        type Mutability = InteriorMutable;
92    }
93);
94
95#[cfg(feature = "Foundation_NSHTTPURLResponse")]
96unsafe impl Send for NSHTTPURLResponse {}
97
98#[cfg(feature = "Foundation_NSHTTPURLResponse")]
99unsafe impl Sync for NSHTTPURLResponse {}
100
101#[cfg(feature = "Foundation_NSHTTPURLResponse")]
102unsafe impl NSCoding for NSHTTPURLResponse {}
103
104#[cfg(feature = "Foundation_NSHTTPURLResponse")]
105unsafe impl NSCopying for NSHTTPURLResponse {}
106
107#[cfg(feature = "Foundation_NSHTTPURLResponse")]
108unsafe impl NSObjectProtocol for NSHTTPURLResponse {}
109
110#[cfg(feature = "Foundation_NSHTTPURLResponse")]
111unsafe impl NSSecureCoding for NSHTTPURLResponse {}
112
113extern_methods!(
114    #[cfg(feature = "Foundation_NSHTTPURLResponse")]
115    unsafe impl NSHTTPURLResponse {
116        #[cfg(all(
117            feature = "Foundation_NSDictionary",
118            feature = "Foundation_NSString",
119            feature = "Foundation_NSURL"
120        ))]
121        #[method_id(@__retain_semantics Init initWithURL:statusCode:HTTPVersion:headerFields:)]
122        pub unsafe fn initWithURL_statusCode_HTTPVersion_headerFields(
123            this: Allocated<Self>,
124            url: &NSURL,
125            status_code: NSInteger,
126            http_version: Option<&NSString>,
127            header_fields: Option<&NSDictionary<NSString, NSString>>,
128        ) -> Option<Id<Self>>;
129
130        #[method(statusCode)]
131        pub unsafe fn statusCode(&self) -> NSInteger;
132
133        #[cfg(feature = "Foundation_NSDictionary")]
134        #[method_id(@__retain_semantics Other allHeaderFields)]
135        pub unsafe fn allHeaderFields(&self) -> Id<NSDictionary>;
136
137        #[cfg(feature = "Foundation_NSString")]
138        #[method_id(@__retain_semantics Other valueForHTTPHeaderField:)]
139        pub unsafe fn valueForHTTPHeaderField(&self, field: &NSString) -> Option<Id<NSString>>;
140
141        #[cfg(feature = "Foundation_NSString")]
142        #[method_id(@__retain_semantics Other localizedStringForStatusCode:)]
143        pub unsafe fn localizedStringForStatusCode(status_code: NSInteger) -> Id<NSString>;
144    }
145);
146
147extern_methods!(
148    /// Methods declared on superclass `NSURLResponse`
149    #[cfg(feature = "Foundation_NSHTTPURLResponse")]
150    unsafe impl NSHTTPURLResponse {
151        #[cfg(all(feature = "Foundation_NSString", feature = "Foundation_NSURL"))]
152        #[method_id(@__retain_semantics Init initWithURL:MIMEType:expectedContentLength:textEncodingName:)]
153        pub unsafe fn initWithURL_MIMEType_expectedContentLength_textEncodingName(
154            this: Allocated<Self>,
155            url: &NSURL,
156            mime_type: Option<&NSString>,
157            length: NSInteger,
158            name: Option<&NSString>,
159        ) -> Id<Self>;
160    }
161);
162
163extern_methods!(
164    /// Methods declared on superclass `NSObject`
165    #[cfg(feature = "Foundation_NSHTTPURLResponse")]
166    unsafe impl NSHTTPURLResponse {
167        #[method_id(@__retain_semantics Init init)]
168        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
169
170        #[method_id(@__retain_semantics New new)]
171        pub unsafe fn new() -> Id<Self>;
172    }
173);