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 unsafe 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 unsafe 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 unsafe 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 unsafe 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 unsafe 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:))]
125 #[unsafe(method_family = none)]
126 pub unsafe fn removeCredential_forProtectionSpace_options(
127 &self,
128 credential: &NSURLCredential,
129 space: &NSURLProtectionSpace,
130 options: Option<&NSDictionary<NSString, AnyObject>>,
131 );
132
133 #[cfg(all(feature = "NSURLCredential", feature = "NSURLProtectionSpace"))]
134 #[unsafe(method(defaultCredentialForProtectionSpace:))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn defaultCredentialForProtectionSpace(
140 &self,
141 space: &NSURLProtectionSpace,
142 ) -> Option<Retained<NSURLCredential>>;
143
144 #[cfg(all(feature = "NSURLCredential", feature = "NSURLProtectionSpace"))]
145 #[unsafe(method(setDefaultCredential:forProtectionSpace:))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn setDefaultCredential_forProtectionSpace(
155 &self,
156 credential: &NSURLCredential,
157 space: &NSURLProtectionSpace,
158 );
159 );
160}
161
162impl NSURLCredentialStorage {
164 extern_methods!(
165 #[unsafe(method(init))]
166 #[unsafe(method_family = init)]
167 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
168
169 #[unsafe(method(new))]
170 #[unsafe(method_family = new)]
171 pub unsafe fn new() -> Retained<Self>;
172 );
173}
174
175impl NSURLCredentialStorage {
177 extern_methods!(
178 #[cfg(all(
179 feature = "NSDictionary",
180 feature = "NSString",
181 feature = "NSURLCredential",
182 feature = "NSURLProtectionSpace",
183 feature = "NSURLSession",
184 feature = "block2"
185 ))]
186 #[unsafe(method(getCredentialsForProtectionSpace:task:completionHandler:))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn getCredentialsForProtectionSpace_task_completionHandler(
189 &self,
190 protection_space: &NSURLProtectionSpace,
191 task: &NSURLSessionTask,
192 completion_handler: &block2::DynBlock<
193 dyn Fn(*mut NSDictionary<NSString, NSURLCredential>),
194 >,
195 );
196
197 #[cfg(all(
198 feature = "NSURLCredential",
199 feature = "NSURLProtectionSpace",
200 feature = "NSURLSession"
201 ))]
202 #[unsafe(method(setCredential:forProtectionSpace:task:))]
203 #[unsafe(method_family = none)]
204 pub unsafe fn setCredential_forProtectionSpace_task(
205 &self,
206 credential: &NSURLCredential,
207 protection_space: &NSURLProtectionSpace,
208 task: &NSURLSessionTask,
209 );
210
211 #[cfg(all(
212 feature = "NSDictionary",
213 feature = "NSString",
214 feature = "NSURLCredential",
215 feature = "NSURLProtectionSpace",
216 feature = "NSURLSession"
217 ))]
218 #[unsafe(method(removeCredential:forProtectionSpace:options:task:))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn removeCredential_forProtectionSpace_options_task(
221 &self,
222 credential: &NSURLCredential,
223 protection_space: &NSURLProtectionSpace,
224 options: Option<&NSDictionary<NSString, AnyObject>>,
225 task: &NSURLSessionTask,
226 );
227
228 #[cfg(all(
229 feature = "NSURLCredential",
230 feature = "NSURLProtectionSpace",
231 feature = "NSURLSession",
232 feature = "block2"
233 ))]
234 #[unsafe(method(getDefaultCredentialForProtectionSpace:task:completionHandler:))]
235 #[unsafe(method_family = none)]
236 pub unsafe fn getDefaultCredentialForProtectionSpace_task_completionHandler(
237 &self,
238 space: &NSURLProtectionSpace,
239 task: &NSURLSessionTask,
240 completion_handler: &block2::DynBlock<dyn Fn(*mut NSURLCredential)>,
241 );
242
243 #[cfg(all(
244 feature = "NSURLCredential",
245 feature = "NSURLProtectionSpace",
246 feature = "NSURLSession"
247 ))]
248 #[unsafe(method(setDefaultCredential:forProtectionSpace:task:))]
249 #[unsafe(method_family = none)]
250 pub unsafe fn setDefaultCredential_forProtectionSpace_task(
251 &self,
252 credential: &NSURLCredential,
253 protection_space: &NSURLProtectionSpace,
254 task: &NSURLSessionTask,
255 );
256 );
257}
258
259extern "C" {
260 #[cfg(all(feature = "NSNotification", feature = "NSString"))]
265 pub static NSURLCredentialStorageChangedNotification: &'static NSNotificationName;
266}
267
268extern "C" {
269 #[cfg(feature = "NSString")]
271 pub static NSURLCredentialStorageRemoveSynchronizableCredentials: &'static NSString;
272}