icrate/generated/Foundation/
NSURLCredentialStorage.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_NSURLCredentialStorage")]
9    pub struct NSURLCredentialStorage;
10
11    #[cfg(feature = "Foundation_NSURLCredentialStorage")]
12    unsafe impl ClassType for NSURLCredentialStorage {
13        type Super = NSObject;
14        type Mutability = InteriorMutable;
15    }
16);
17
18#[cfg(feature = "Foundation_NSURLCredentialStorage")]
19unsafe impl Send for NSURLCredentialStorage {}
20
21#[cfg(feature = "Foundation_NSURLCredentialStorage")]
22unsafe impl Sync for NSURLCredentialStorage {}
23
24#[cfg(feature = "Foundation_NSURLCredentialStorage")]
25unsafe impl NSObjectProtocol for NSURLCredentialStorage {}
26
27extern_methods!(
28    #[cfg(feature = "Foundation_NSURLCredentialStorage")]
29    unsafe impl NSURLCredentialStorage {
30        #[method_id(@__retain_semantics Other sharedCredentialStorage)]
31        pub unsafe fn sharedCredentialStorage() -> Id<NSURLCredentialStorage>;
32
33        #[cfg(all(
34            feature = "Foundation_NSDictionary",
35            feature = "Foundation_NSString",
36            feature = "Foundation_NSURLCredential",
37            feature = "Foundation_NSURLProtectionSpace"
38        ))]
39        #[method_id(@__retain_semantics Other credentialsForProtectionSpace:)]
40        pub unsafe fn credentialsForProtectionSpace(
41            &self,
42            space: &NSURLProtectionSpace,
43        ) -> Option<Id<NSDictionary<NSString, NSURLCredential>>>;
44
45        #[cfg(all(
46            feature = "Foundation_NSDictionary",
47            feature = "Foundation_NSString",
48            feature = "Foundation_NSURLCredential",
49            feature = "Foundation_NSURLProtectionSpace"
50        ))]
51        #[method_id(@__retain_semantics Other allCredentials)]
52        pub unsafe fn allCredentials(
53            &self,
54        ) -> Id<NSDictionary<NSURLProtectionSpace, NSDictionary<NSString, NSURLCredential>>>;
55
56        #[cfg(all(
57            feature = "Foundation_NSURLCredential",
58            feature = "Foundation_NSURLProtectionSpace"
59        ))]
60        #[method(setCredential:forProtectionSpace:)]
61        pub unsafe fn setCredential_forProtectionSpace(
62            &self,
63            credential: &NSURLCredential,
64            space: &NSURLProtectionSpace,
65        );
66
67        #[cfg(all(
68            feature = "Foundation_NSURLCredential",
69            feature = "Foundation_NSURLProtectionSpace"
70        ))]
71        #[method(removeCredential:forProtectionSpace:)]
72        pub unsafe fn removeCredential_forProtectionSpace(
73            &self,
74            credential: &NSURLCredential,
75            space: &NSURLProtectionSpace,
76        );
77
78        #[cfg(all(
79            feature = "Foundation_NSDictionary",
80            feature = "Foundation_NSString",
81            feature = "Foundation_NSURLCredential",
82            feature = "Foundation_NSURLProtectionSpace"
83        ))]
84        #[method(removeCredential:forProtectionSpace:options:)]
85        pub unsafe fn removeCredential_forProtectionSpace_options(
86            &self,
87            credential: &NSURLCredential,
88            space: &NSURLProtectionSpace,
89            options: Option<&NSDictionary<NSString, AnyObject>>,
90        );
91
92        #[cfg(all(
93            feature = "Foundation_NSURLCredential",
94            feature = "Foundation_NSURLProtectionSpace"
95        ))]
96        #[method_id(@__retain_semantics Other defaultCredentialForProtectionSpace:)]
97        pub unsafe fn defaultCredentialForProtectionSpace(
98            &self,
99            space: &NSURLProtectionSpace,
100        ) -> Option<Id<NSURLCredential>>;
101
102        #[cfg(all(
103            feature = "Foundation_NSURLCredential",
104            feature = "Foundation_NSURLProtectionSpace"
105        ))]
106        #[method(setDefaultCredential:forProtectionSpace:)]
107        pub unsafe fn setDefaultCredential_forProtectionSpace(
108            &self,
109            credential: &NSURLCredential,
110            space: &NSURLProtectionSpace,
111        );
112    }
113);
114
115extern_methods!(
116    /// Methods declared on superclass `NSObject`
117    #[cfg(feature = "Foundation_NSURLCredentialStorage")]
118    unsafe impl NSURLCredentialStorage {
119        #[method_id(@__retain_semantics Init init)]
120        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
121
122        #[method_id(@__retain_semantics New new)]
123        pub unsafe fn new() -> Id<Self>;
124    }
125);
126
127extern_methods!(
128    /// NSURLSessionTaskAdditions
129    #[cfg(feature = "Foundation_NSURLCredentialStorage")]
130    unsafe impl NSURLCredentialStorage {
131        #[cfg(all(
132            feature = "Foundation_NSDictionary",
133            feature = "Foundation_NSString",
134            feature = "Foundation_NSURLCredential",
135            feature = "Foundation_NSURLProtectionSpace",
136            feature = "Foundation_NSURLSessionTask"
137        ))]
138        #[method(getCredentialsForProtectionSpace:task:completionHandler:)]
139        pub unsafe fn getCredentialsForProtectionSpace_task_completionHandler(
140            &self,
141            protection_space: &NSURLProtectionSpace,
142            task: &NSURLSessionTask,
143            completion_handler: &Block<(*mut NSDictionary<NSString, NSURLCredential>,), ()>,
144        );
145
146        #[cfg(all(
147            feature = "Foundation_NSURLCredential",
148            feature = "Foundation_NSURLProtectionSpace",
149            feature = "Foundation_NSURLSessionTask"
150        ))]
151        #[method(setCredential:forProtectionSpace:task:)]
152        pub unsafe fn setCredential_forProtectionSpace_task(
153            &self,
154            credential: &NSURLCredential,
155            protection_space: &NSURLProtectionSpace,
156            task: &NSURLSessionTask,
157        );
158
159        #[cfg(all(
160            feature = "Foundation_NSDictionary",
161            feature = "Foundation_NSString",
162            feature = "Foundation_NSURLCredential",
163            feature = "Foundation_NSURLProtectionSpace",
164            feature = "Foundation_NSURLSessionTask"
165        ))]
166        #[method(removeCredential:forProtectionSpace:options:task:)]
167        pub unsafe fn removeCredential_forProtectionSpace_options_task(
168            &self,
169            credential: &NSURLCredential,
170            protection_space: &NSURLProtectionSpace,
171            options: Option<&NSDictionary<NSString, AnyObject>>,
172            task: &NSURLSessionTask,
173        );
174
175        #[cfg(all(
176            feature = "Foundation_NSURLCredential",
177            feature = "Foundation_NSURLProtectionSpace",
178            feature = "Foundation_NSURLSessionTask"
179        ))]
180        #[method(getDefaultCredentialForProtectionSpace:task:completionHandler:)]
181        pub unsafe fn getDefaultCredentialForProtectionSpace_task_completionHandler(
182            &self,
183            space: &NSURLProtectionSpace,
184            task: &NSURLSessionTask,
185            completion_handler: &Block<(*mut NSURLCredential,), ()>,
186        );
187
188        #[cfg(all(
189            feature = "Foundation_NSURLCredential",
190            feature = "Foundation_NSURLProtectionSpace",
191            feature = "Foundation_NSURLSessionTask"
192        ))]
193        #[method(setDefaultCredential:forProtectionSpace:task:)]
194        pub unsafe fn setDefaultCredential_forProtectionSpace_task(
195            &self,
196            credential: &NSURLCredential,
197            protection_space: &NSURLProtectionSpace,
198            task: &NSURLSessionTask,
199        );
200    }
201);
202
203extern_static!(NSURLCredentialStorageChangedNotification: &'static NSNotificationName);
204
205extern_static!(NSURLCredentialStorageRemoveSynchronizableCredentials: &'static NSString);