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
22unsafe impl NSObjectProtocol for NSURLCredentialStorage {}
23
24impl NSURLCredentialStorage {
25 extern_methods!(
26 #[unsafe(method(sharedCredentialStorage))]
30 #[unsafe(method_family = none)]
31 pub unsafe fn sharedCredentialStorage() -> Retained<NSURLCredentialStorage>;
32
33 #[cfg(all(
34 feature = "NSDictionary",
35 feature = "NSString",
36 feature = "NSURLCredential",
37 feature = "NSURLProtectionSpace"
38 ))]
39 #[unsafe(method(credentialsForProtectionSpace:))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn credentialsForProtectionSpace(
47 &self,
48 space: &NSURLProtectionSpace,
49 ) -> Option<Retained<NSDictionary<NSString, NSURLCredential>>>;
50
51 #[cfg(all(
52 feature = "NSDictionary",
53 feature = "NSString",
54 feature = "NSURLCredential",
55 feature = "NSURLProtectionSpace"
56 ))]
57 #[unsafe(method(allCredentials))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn allCredentials(
65 &self,
66 ) -> Retained<NSDictionary<NSURLProtectionSpace, NSDictionary<NSString, NSURLCredential>>>;
67
68 #[cfg(all(feature = "NSURLCredential", feature = "NSURLProtectionSpace"))]
69 #[unsafe(method(setCredential:forProtectionSpace:))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn setCredential_forProtectionSpace(
81 &self,
82 credential: &NSURLCredential,
83 space: &NSURLProtectionSpace,
84 );
85
86 #[cfg(all(feature = "NSURLCredential", feature = "NSURLProtectionSpace"))]
87 #[unsafe(method(removeCredential:forProtectionSpace:))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn removeCredential_forProtectionSpace(
99 &self,
100 credential: &NSURLCredential,
101 space: &NSURLProtectionSpace,
102 );
103
104 #[cfg(all(
105 feature = "NSDictionary",
106 feature = "NSString",
107 feature = "NSURLCredential",
108 feature = "NSURLProtectionSpace"
109 ))]
110 #[unsafe(method(removeCredential:forProtectionSpace:options:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn removeCredential_forProtectionSpace_options(
125 &self,
126 credential: &NSURLCredential,
127 space: &NSURLProtectionSpace,
128 options: Option<&NSDictionary<NSString, AnyObject>>,
129 );
130
131 #[cfg(all(feature = "NSURLCredential", feature = "NSURLProtectionSpace"))]
132 #[unsafe(method(defaultCredentialForProtectionSpace:))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn defaultCredentialForProtectionSpace(
138 &self,
139 space: &NSURLProtectionSpace,
140 ) -> Option<Retained<NSURLCredential>>;
141
142 #[cfg(all(feature = "NSURLCredential", feature = "NSURLProtectionSpace"))]
143 #[unsafe(method(setDefaultCredential:forProtectionSpace:))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn setDefaultCredential_forProtectionSpace(
153 &self,
154 credential: &NSURLCredential,
155 space: &NSURLProtectionSpace,
156 );
157 );
158}
159
160impl NSURLCredentialStorage {
162 extern_methods!(
163 #[unsafe(method(init))]
164 #[unsafe(method_family = init)]
165 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
166
167 #[unsafe(method(new))]
168 #[unsafe(method_family = new)]
169 pub unsafe fn new() -> Retained<Self>;
170 );
171}
172
173impl NSURLCredentialStorage {
175 extern_methods!(
176 #[cfg(all(
177 feature = "NSDictionary",
178 feature = "NSString",
179 feature = "NSURLCredential",
180 feature = "NSURLProtectionSpace",
181 feature = "NSURLSession",
182 feature = "block2"
183 ))]
184 #[unsafe(method(getCredentialsForProtectionSpace:task:completionHandler:))]
185 #[unsafe(method_family = none)]
186 pub unsafe fn getCredentialsForProtectionSpace_task_completionHandler(
187 &self,
188 protection_space: &NSURLProtectionSpace,
189 task: &NSURLSessionTask,
190 completion_handler: &block2::Block<
191 dyn Fn(*mut NSDictionary<NSString, NSURLCredential>),
192 >,
193 );
194
195 #[cfg(all(
196 feature = "NSURLCredential",
197 feature = "NSURLProtectionSpace",
198 feature = "NSURLSession"
199 ))]
200 #[unsafe(method(setCredential:forProtectionSpace:task:))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn setCredential_forProtectionSpace_task(
203 &self,
204 credential: &NSURLCredential,
205 protection_space: &NSURLProtectionSpace,
206 task: &NSURLSessionTask,
207 );
208
209 #[cfg(all(
210 feature = "NSDictionary",
211 feature = "NSString",
212 feature = "NSURLCredential",
213 feature = "NSURLProtectionSpace",
214 feature = "NSURLSession"
215 ))]
216 #[unsafe(method(removeCredential:forProtectionSpace:options:task:))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn removeCredential_forProtectionSpace_options_task(
219 &self,
220 credential: &NSURLCredential,
221 protection_space: &NSURLProtectionSpace,
222 options: Option<&NSDictionary<NSString, AnyObject>>,
223 task: &NSURLSessionTask,
224 );
225
226 #[cfg(all(
227 feature = "NSURLCredential",
228 feature = "NSURLProtectionSpace",
229 feature = "NSURLSession",
230 feature = "block2"
231 ))]
232 #[unsafe(method(getDefaultCredentialForProtectionSpace:task:completionHandler:))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn getDefaultCredentialForProtectionSpace_task_completionHandler(
235 &self,
236 space: &NSURLProtectionSpace,
237 task: &NSURLSessionTask,
238 completion_handler: &block2::Block<dyn Fn(*mut NSURLCredential)>,
239 );
240
241 #[cfg(all(
242 feature = "NSURLCredential",
243 feature = "NSURLProtectionSpace",
244 feature = "NSURLSession"
245 ))]
246 #[unsafe(method(setDefaultCredential:forProtectionSpace:task:))]
247 #[unsafe(method_family = none)]
248 pub unsafe fn setDefaultCredential_forProtectionSpace_task(
249 &self,
250 credential: &NSURLCredential,
251 protection_space: &NSURLProtectionSpace,
252 task: &NSURLSessionTask,
253 );
254 );
255}
256
257extern "C" {
258 #[cfg(all(feature = "NSNotification", feature = "NSString"))]
263 pub static NSURLCredentialStorageChangedNotification: &'static NSNotificationName;
264}
265
266extern "C" {
267 #[cfg(feature = "NSString")]
269 pub static NSURLCredentialStorageRemoveSynchronizableCredentials: &'static NSString;
270}