objc2_foundation/generated/
NSURLCredentialStorage.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSObject))]
14 #[derive(Debug, PartialEq, Eq, Hash)]
15 pub struct NSURLCredentialStorage;
16);
17
18unsafe impl Send for NSURLCredentialStorage {}
19
20unsafe impl Sync for NSURLCredentialStorage {}
21
22extern_conformance!(
23 unsafe impl NSObjectProtocol for NSURLCredentialStorage {}
24);
25
26impl NSURLCredentialStorage {
27 extern_methods!(
28 #[unsafe(method(sharedCredentialStorage))]
32 #[unsafe(method_family = none)]
33 pub fn sharedCredentialStorage() -> Retained<NSURLCredentialStorage>;
34
35 #[cfg(all(
36 feature = "NSDictionary",
37 feature = "NSString",
38 feature = "NSURLCredential",
39 feature = "NSURLProtectionSpace"
40 ))]
41 #[unsafe(method(credentialsForProtectionSpace:))]
47 #[unsafe(method_family = none)]
48 pub fn credentialsForProtectionSpace(
49 &self,
50 space: &NSURLProtectionSpace,
51 ) -> Option<Retained<NSDictionary<NSString, NSURLCredential>>>;
52
53 #[cfg(all(
54 feature = "NSDictionary",
55 feature = "NSString",
56 feature = "NSURLCredential",
57 feature = "NSURLProtectionSpace"
58 ))]
59 #[unsafe(method(allCredentials))]
65 #[unsafe(method_family = none)]
66 pub fn allCredentials(
67 &self,
68 ) -> Retained<NSDictionary<NSURLProtectionSpace, NSDictionary<NSString, NSURLCredential>>>;
69
70 #[cfg(all(feature = "NSURLCredential", feature = "NSURLProtectionSpace"))]
71 #[unsafe(method(setCredential:forProtectionSpace:))]
81 #[unsafe(method_family = none)]
82 pub fn setCredential_forProtectionSpace(
83 &self,
84 credential: &NSURLCredential,
85 space: &NSURLProtectionSpace,
86 );
87
88 #[cfg(all(feature = "NSURLCredential", feature = "NSURLProtectionSpace"))]
89 #[unsafe(method(removeCredential:forProtectionSpace:))]
99 #[unsafe(method_family = none)]
100 pub fn removeCredential_forProtectionSpace(
101 &self,
102 credential: &NSURLCredential,
103 space: &NSURLProtectionSpace,
104 );
105
106 #[cfg(all(
107 feature = "NSDictionary",
108 feature = "NSString",
109 feature = "NSURLCredential",
110 feature = "NSURLProtectionSpace"
111 ))]
112 #[unsafe(method(removeCredential:forProtectionSpace:options:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn removeCredential_forProtectionSpace_options(
131 &self,
132 credential: &NSURLCredential,
133 space: &NSURLProtectionSpace,
134 options: Option<&NSDictionary<NSString, AnyObject>>,
135 );
136
137 #[cfg(all(feature = "NSURLCredential", feature = "NSURLProtectionSpace"))]
138 #[unsafe(method(defaultCredentialForProtectionSpace:))]
142 #[unsafe(method_family = none)]
143 pub fn defaultCredentialForProtectionSpace(
144 &self,
145 space: &NSURLProtectionSpace,
146 ) -> Option<Retained<NSURLCredential>>;
147
148 #[cfg(all(feature = "NSURLCredential", feature = "NSURLProtectionSpace"))]
149 #[unsafe(method(setDefaultCredential:forProtectionSpace:))]
157 #[unsafe(method_family = none)]
158 pub fn setDefaultCredential_forProtectionSpace(
159 &self,
160 credential: &NSURLCredential,
161 space: &NSURLProtectionSpace,
162 );
163 );
164}
165
166impl NSURLCredentialStorage {
168 extern_methods!(
169 #[unsafe(method(init))]
170 #[unsafe(method_family = init)]
171 pub fn init(this: Allocated<Self>) -> Retained<Self>;
172
173 #[unsafe(method(new))]
174 #[unsafe(method_family = new)]
175 pub fn new() -> Retained<Self>;
176 );
177}
178
179impl DefaultRetained for NSURLCredentialStorage {
180 #[inline]
181 fn default_retained() -> Retained<Self> {
182 Self::new()
183 }
184}
185
186impl NSURLCredentialStorage {
188 extern_methods!(
189 #[cfg(all(
190 feature = "NSDictionary",
191 feature = "NSString",
192 feature = "NSURLCredential",
193 feature = "NSURLProtectionSpace",
194 feature = "NSURLSession",
195 feature = "block2"
196 ))]
197 #[unsafe(method(getCredentialsForProtectionSpace:task:completionHandler:))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn getCredentialsForProtectionSpace_task_completionHandler(
203 &self,
204 protection_space: &NSURLProtectionSpace,
205 task: &NSURLSessionTask,
206 completion_handler: &block2::DynBlock<
207 dyn Fn(*mut NSDictionary<NSString, NSURLCredential>),
208 >,
209 );
210
211 #[cfg(all(
212 feature = "NSURLCredential",
213 feature = "NSURLProtectionSpace",
214 feature = "NSURLSession"
215 ))]
216 #[unsafe(method(setCredential:forProtectionSpace:task:))]
217 #[unsafe(method_family = none)]
218 pub fn setCredential_forProtectionSpace_task(
219 &self,
220 credential: &NSURLCredential,
221 protection_space: &NSURLProtectionSpace,
222 task: &NSURLSessionTask,
223 );
224
225 #[cfg(all(
226 feature = "NSDictionary",
227 feature = "NSString",
228 feature = "NSURLCredential",
229 feature = "NSURLProtectionSpace",
230 feature = "NSURLSession"
231 ))]
232 #[unsafe(method(removeCredential:forProtectionSpace:options:task:))]
236 #[unsafe(method_family = none)]
237 pub unsafe fn removeCredential_forProtectionSpace_options_task(
238 &self,
239 credential: &NSURLCredential,
240 protection_space: &NSURLProtectionSpace,
241 options: Option<&NSDictionary<NSString, AnyObject>>,
242 task: &NSURLSessionTask,
243 );
244
245 #[cfg(all(
246 feature = "NSURLCredential",
247 feature = "NSURLProtectionSpace",
248 feature = "NSURLSession",
249 feature = "block2"
250 ))]
251 #[unsafe(method(getDefaultCredentialForProtectionSpace:task:completionHandler:))]
255 #[unsafe(method_family = none)]
256 pub unsafe fn getDefaultCredentialForProtectionSpace_task_completionHandler(
257 &self,
258 space: &NSURLProtectionSpace,
259 task: &NSURLSessionTask,
260 completion_handler: &block2::DynBlock<dyn Fn(*mut NSURLCredential)>,
261 );
262
263 #[cfg(all(
264 feature = "NSURLCredential",
265 feature = "NSURLProtectionSpace",
266 feature = "NSURLSession"
267 ))]
268 #[unsafe(method(setDefaultCredential:forProtectionSpace:task:))]
269 #[unsafe(method_family = none)]
270 pub fn setDefaultCredential_forProtectionSpace_task(
271 &self,
272 credential: &NSURLCredential,
273 protection_space: &NSURLProtectionSpace,
274 task: &NSURLSessionTask,
275 );
276 );
277}
278
279extern "C" {
280 #[cfg(all(feature = "NSNotification", feature = "NSString"))]
285 #[deprecated = "Notification is never posted"]
286 pub static NSURLCredentialStorageChangedNotification: &'static NSNotificationName;
287}
288
289extern "C" {
290 #[cfg(feature = "NSString")]
292 pub static NSURLCredentialStorageRemoveSynchronizableCredentials: &'static NSString;
293}