objc2_foundation/generated/NSHTTPCookie.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiepropertykey?language=objc)
9// NS_TYPED_EXTENSIBLE_ENUM
10#[cfg(feature = "NSString")]
11pub type NSHTTPCookiePropertyKey = NSString;
12
13/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiestringpolicy?language=objc)
14// NS_TYPED_ENUM
15#[cfg(feature = "NSString")]
16pub type NSHTTPCookieStringPolicy = NSString;
17
18extern "C" {
19 /// Key for cookie name
20 ///
21 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiename?language=objc)
22 #[cfg(feature = "NSString")]
23 pub static NSHTTPCookieName: &'static NSHTTPCookiePropertyKey;
24}
25
26extern "C" {
27 /// Key for cookie value
28 ///
29 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookievalue?language=objc)
30 #[cfg(feature = "NSString")]
31 pub static NSHTTPCookieValue: &'static NSHTTPCookiePropertyKey;
32}
33
34extern "C" {
35 /// Key for cookie origin URL
36 ///
37 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookieoriginurl?language=objc)
38 #[cfg(feature = "NSString")]
39 pub static NSHTTPCookieOriginURL: &'static NSHTTPCookiePropertyKey;
40}
41
42extern "C" {
43 /// Key for cookie version
44 ///
45 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookieversion?language=objc)
46 #[cfg(feature = "NSString")]
47 pub static NSHTTPCookieVersion: &'static NSHTTPCookiePropertyKey;
48}
49
50extern "C" {
51 /// Key for cookie domain
52 ///
53 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiedomain?language=objc)
54 #[cfg(feature = "NSString")]
55 pub static NSHTTPCookieDomain: &'static NSHTTPCookiePropertyKey;
56}
57
58extern "C" {
59 /// Key for cookie path
60 ///
61 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiepath?language=objc)
62 #[cfg(feature = "NSString")]
63 pub static NSHTTPCookiePath: &'static NSHTTPCookiePropertyKey;
64}
65
66extern "C" {
67 /// Key for cookie secure flag
68 ///
69 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiesecure?language=objc)
70 #[cfg(feature = "NSString")]
71 pub static NSHTTPCookieSecure: &'static NSHTTPCookiePropertyKey;
72}
73
74extern "C" {
75 /// Key for cookie expiration date
76 ///
77 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookieexpires?language=objc)
78 #[cfg(feature = "NSString")]
79 pub static NSHTTPCookieExpires: &'static NSHTTPCookiePropertyKey;
80}
81
82extern "C" {
83 /// Key for cookie comment text
84 ///
85 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiecomment?language=objc)
86 #[cfg(feature = "NSString")]
87 pub static NSHTTPCookieComment: &'static NSHTTPCookiePropertyKey;
88}
89
90extern "C" {
91 /// Key for cookie comment URL
92 ///
93 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiecommenturl?language=objc)
94 #[cfg(feature = "NSString")]
95 pub static NSHTTPCookieCommentURL: &'static NSHTTPCookiePropertyKey;
96}
97
98extern "C" {
99 /// Key for cookie discard (session-only) flag
100 ///
101 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiediscard?language=objc)
102 #[cfg(feature = "NSString")]
103 pub static NSHTTPCookieDiscard: &'static NSHTTPCookiePropertyKey;
104}
105
106extern "C" {
107 /// Key for cookie maximum age (an alternate way of specifying the expiration)
108 ///
109 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiemaximumage?language=objc)
110 #[cfg(feature = "NSString")]
111 pub static NSHTTPCookieMaximumAge: &'static NSHTTPCookiePropertyKey;
112}
113
114extern "C" {
115 /// Key for cookie ports
116 ///
117 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookieport?language=objc)
118 #[cfg(feature = "NSString")]
119 pub static NSHTTPCookiePort: &'static NSHTTPCookiePropertyKey;
120}
121
122extern "C" {
123 /// An NSString object indicating that the cookie is set via JavaScript.
124 ///
125 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiesetbyjavascript?language=objc)
126 #[cfg(feature = "NSString")]
127 pub static NSHTTPCookieSetByJavaScript: &'static NSHTTPCookiePropertyKey;
128}
129
130extern "C" {
131 /// Key for cookie same site
132 ///
133 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiesamesitepolicy?language=objc)
134 #[cfg(feature = "NSString")]
135 pub static NSHTTPCookieSameSitePolicy: &'static NSHTTPCookiePropertyKey;
136}
137
138extern "C" {
139 /// String constant "lax" to be used as a value for the property key NSHTTPCookieSameSite
140 ///
141 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiesamesitelax?language=objc)
142 #[cfg(feature = "NSString")]
143 pub static NSHTTPCookieSameSiteLax: &'static NSHTTPCookieStringPolicy;
144}
145
146extern "C" {
147 /// String constant "strict" to be used as a value for the property key NSHTTPCookieSameSite
148 ///
149 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiesamesitestrict?language=objc)
150 #[cfg(feature = "NSString")]
151 pub static NSHTTPCookieSameSiteStrict: &'static NSHTTPCookieStringPolicy;
152}
153
154extern_class!(
155 /// NSHTTPCookie represents an http cookie.
156 ///
157 /// A NSHTTPCookie instance represents a single http cookie. It is
158 /// an immutable object initialized from a dictionary that contains
159 /// the various cookie attributes. It has accessors to get the various
160 /// attributes of a cookie.
161 ///
162 /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookie?language=objc)
163 #[unsafe(super(NSObject))]
164 #[derive(Debug, PartialEq, Eq, Hash)]
165 pub struct NSHTTPCookie;
166);
167
168unsafe impl Send for NSHTTPCookie {}
169
170unsafe impl Sync for NSHTTPCookie {}
171
172extern_conformance!(
173 unsafe impl NSObjectProtocol for NSHTTPCookie {}
174);
175
176impl NSHTTPCookie {
177 extern_methods!(
178 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
179 /// Initialize a NSHTTPCookie object with a dictionary of
180 /// parameters
181 ///
182 /// Parameter `properties`: The dictionary of properties to be used to
183 /// initialize this cookie.
184 ///
185 /// Supported dictionary keys and value types for the
186 /// given dictionary are as follows.
187 ///
188 /// All properties can handle an NSString value, but some can also
189 /// handle other types.
190 ///
191 /// <table border="1" cellspacing="2" cellpadding="4">
192 /// <tr>
193 /// <th>
194 /// Property key constant
195 /// </th>
196 /// <th>
197 /// Type of value
198 /// </th>
199 /// <th>
200 /// Required
201 /// </th>
202 /// <th>
203 /// Description
204 /// </th>
205 /// </tr>
206 /// <tr>
207 /// <td>
208 /// NSHTTPCookieComment
209 /// </td>
210 /// <td>
211 /// NSString
212 /// </td>
213 /// <td>
214 /// NO
215 /// </td>
216 /// <td>
217 /// Comment for the cookie. Only valid for version 1 cookies and
218 /// later. Default is nil.
219 /// </td>
220 /// </tr>
221 /// <tr>
222 /// <td>
223 /// NSHTTPCookieCommentURL
224 /// </td>
225 /// <td>
226 /// NSURL or NSString
227 /// </td>
228 /// <td>
229 /// NO
230 /// </td>
231 /// <td>
232 /// Comment URL for the cookie. Only valid for version 1 cookies
233 /// and later. Default is nil.
234 /// </td>
235 /// </tr>
236 /// <tr>
237 /// <td>
238 /// NSHTTPCookieDomain
239 /// </td>
240 /// <td>
241 /// NSString
242 /// </td>
243 /// <td>
244 /// Special, a value for either NSHTTPCookieOriginURL or
245 /// NSHTTPCookieDomain must be specified.
246 /// </td>
247 /// <td>
248 /// Domain for the cookie. Inferred from the value for
249 /// NSHTTPCookieOriginURL if not provided.
250 /// </td>
251 /// </tr>
252 /// <tr>
253 /// <td>
254 /// NSHTTPCookieDiscard
255 /// </td>
256 /// <td>
257 /// NSString
258 /// </td>
259 /// <td>
260 /// NO
261 /// </td>
262 /// <td>
263 /// A string stating whether the cookie should be discarded at
264 /// the end of the session. String value must be either "TRUE" or
265 /// "FALSE". Default is "FALSE", unless this is cookie is version
266 /// 1 or greater and a value for NSHTTPCookieMaximumAge is not
267 /// specified, in which case it is assumed "TRUE".
268 /// </td>
269 /// </tr>
270 /// <tr>
271 /// <td>
272 /// NSHTTPCookieExpires
273 /// </td>
274 /// <td>
275 /// NSDate or NSString
276 /// </td>
277 /// <td>
278 /// NO
279 /// </td>
280 /// <td>
281 /// Expiration date for the cookie. Used only for version 0
282 /// cookies. Ignored for version 1 or greater.
283 /// </td>
284 /// </tr>
285 /// <tr>
286 /// <td>
287 /// NSHTTPCookieMaximumAge
288 /// </td>
289 /// <td>
290 /// NSString
291 /// </td>
292 /// <td>
293 /// NO
294 /// </td>
295 /// <td>
296 /// A string containing an integer value stating how long in
297 /// seconds the cookie should be kept, at most. Only valid for
298 /// version 1 cookies and later. Default is "0".
299 /// </td>
300 /// </tr>
301 /// <tr>
302 /// <td>
303 /// NSHTTPCookieName
304 /// </td>
305 /// <td>
306 /// NSString
307 /// </td>
308 /// <td>
309 /// YES
310 /// </td>
311 /// <td>
312 /// Name of the cookie
313 /// </td>
314 /// </tr>
315 /// <tr>
316 /// <td>
317 /// NSHTTPCookieOriginURL
318 /// </td>
319 /// <td>
320 /// NSURL or NSString
321 /// </td>
322 /// <td>
323 /// Special, a value for either NSHTTPCookieOriginURL or
324 /// NSHTTPCookieDomain must be specified.
325 /// </td>
326 /// <td>
327 /// URL that set this cookie. Used as default for other fields
328 /// as noted.
329 /// </td>
330 /// </tr>
331 /// <tr>
332 /// <td>
333 /// NSHTTPCookiePath
334 /// </td>
335 /// <td>
336 /// NSString
337 /// </td>
338 /// <td>
339 /// NO
340 /// </td>
341 /// <td>
342 /// Path for the cookie. Inferred from the value for
343 /// NSHTTPCookieOriginURL if not provided. Default is "/".
344 /// </td>
345 /// </tr>
346 /// <tr>
347 /// <td>
348 /// NSHTTPCookiePort
349 /// </td>
350 /// <td>
351 /// NSString
352 /// </td>
353 /// <td>
354 /// NO
355 /// </td>
356 /// <td>
357 /// comma-separated integer values specifying the ports for the
358 /// cookie. Only valid for version 1 cookies and later. Default is
359 /// empty string ("").
360 /// </td>
361 /// </tr>
362 /// <tr>
363 /// <td>
364 /// NSHTTPCookieSecure
365 /// </td>
366 /// <td>
367 /// NSString
368 /// </td>
369 /// <td>
370 /// NO
371 /// </td>
372 /// <td>
373 /// A string stating whether the cookie should be transmitted
374 /// only over secure channels. String value must be either "TRUE"
375 /// or "FALSE". Default is "FALSE".
376 /// </td>
377 /// </tr>
378 /// <tr>
379 /// <td>
380 /// NSHTTPCookieValue
381 /// </td>
382 /// <td>
383 /// NSString
384 /// </td>
385 /// <td>
386 /// YES
387 /// </td>
388 /// <td>
389 /// Value of the cookie
390 /// </td>
391 /// </tr>
392 /// <tr>
393 /// <td>
394 /// NSHTTPCookieVersion
395 /// </td>
396 /// <td>
397 /// NSString
398 /// </td>
399 /// <td>
400 /// NO
401 /// </td>
402 /// <td>
403 /// Specifies the version of the cookie. Must be either "0" or
404 /// "1". Default is "0".
405 /// </td>
406 /// </tr>
407 /// <tr>
408 /// <td>
409 /// NSHTTPCookieSetByJavaScript
410 /// </td>
411 /// <td>
412 /// NSNumber
413 /// </td>
414 /// <td>
415 /// NO
416 /// </td>
417 /// <td>
418 /// `true`if the cookie is set via JavaScript.
419 /// `false`if the cookie
420 /// is not set via JavaScript
421 /// </td>
422 /// </tr>
423 /// </table>
424 /// <p>
425 /// All other keys are ignored.
426 ///
427 /// Returns: An initialized NSHTTPCookie, or nil if the set of
428 /// dictionary keys is invalid, for example because a required key is
429 /// missing, or a recognized key maps to an illegal value.
430 ///
431 /// # Safety
432 ///
433 /// `properties` generic should be of the correct type.
434 #[unsafe(method(initWithProperties:))]
435 #[unsafe(method_family = init)]
436 pub unsafe fn initWithProperties(
437 this: Allocated<Self>,
438 properties: &NSDictionary<NSHTTPCookiePropertyKey, AnyObject>,
439 ) -> Option<Retained<Self>>;
440
441 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
442 /// Allocates and initializes an NSHTTPCookie with the given
443 /// dictionary.
444 ///
445 /// See the NSHTTPCookie
446 /// <tt>
447 /// -initWithProperties:
448 /// </tt>
449 /// method for more information on the constraints imposed on the
450 /// dictionary, and for descriptions of the supported keys and values.
451 ///
452 /// Parameter `properties`: The dictionary to use to initialize this cookie.
453 ///
454 /// Returns: A newly-created and autoreleased NSHTTPCookie instance, or
455 /// nil if the set of dictionary keys is invalid, for example because
456 /// a required key is missing, or a recognized key maps to an illegal
457 /// value.
458 ///
459 /// # Safety
460 ///
461 /// `properties` generic should be of the correct type.
462 #[unsafe(method(cookieWithProperties:))]
463 #[unsafe(method_family = none)]
464 pub unsafe fn cookieWithProperties(
465 properties: &NSDictionary<NSHTTPCookiePropertyKey, AnyObject>,
466 ) -> Option<Retained<NSHTTPCookie>>;
467
468 #[cfg(all(feature = "NSArray", feature = "NSDictionary", feature = "NSString"))]
469 /// Return a dictionary of header fields that can be used to add the
470 /// specified cookies to the request.
471 ///
472 /// Parameter `cookies`: The cookies to turn into request headers.
473 ///
474 /// Returns: An NSDictionary where the keys are header field names, and the values
475 /// are the corresponding header field values.
476 #[unsafe(method(requestHeaderFieldsWithCookies:))]
477 #[unsafe(method_family = none)]
478 pub fn requestHeaderFieldsWithCookies(
479 cookies: &NSArray<NSHTTPCookie>,
480 ) -> Retained<NSDictionary<NSString, NSString>>;
481
482 #[cfg(all(
483 feature = "NSArray",
484 feature = "NSDictionary",
485 feature = "NSString",
486 feature = "NSURL"
487 ))]
488 /// Return an array of cookies parsed from the specified response header fields and URL.
489 ///
490 /// Parameter `headerFields`: The response header fields to check for cookies.
491 ///
492 /// Parameter `URL`: The URL that the cookies came from - relevant to how the cookies are interpreted.
493 ///
494 /// Returns: An NSArray of NSHTTPCookie objects
495 ///
496 /// This method will ignore irrelevant header fields so
497 /// you can pass a dictionary containing data other than cookie data.
498 #[unsafe(method(cookiesWithResponseHeaderFields:forURL:))]
499 #[unsafe(method_family = none)]
500 pub fn cookiesWithResponseHeaderFields_forURL(
501 header_fields: &NSDictionary<NSString, NSString>,
502 url: &NSURL,
503 ) -> Retained<NSArray<NSHTTPCookie>>;
504
505 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
506 /// Returns a dictionary representation of the receiver.
507 ///
508 /// This method returns a dictionary representation of the
509 /// NSHTTPCookie which can be saved and passed to
510 /// <tt>
511 /// -initWithProperties:
512 /// </tt>
513 /// or
514 /// <tt>
515 /// +cookieWithProperties:
516 /// </tt>
517 /// later to reconstitute an equivalent cookie.
518 /// <p>
519 /// See the NSHTTPCookie
520 /// <tt>
521 /// -initWithProperties:
522 /// </tt>
523 /// method for
524 /// more information on the constraints imposed on the dictionary, and
525 /// for descriptions of the supported keys and values.
526 ///
527 /// Returns: The dictionary representation of the receiver.
528 #[unsafe(method(properties))]
529 #[unsafe(method_family = none)]
530 pub fn properties(
531 &self,
532 ) -> Option<Retained<NSDictionary<NSHTTPCookiePropertyKey, AnyObject>>>;
533
534 /// Returns the version of the receiver.
535 ///
536 /// Version 0 maps to "old-style" Netscape cookies.
537 /// Version 1 maps to RFC2965 cookies. There may be future versions.
538 ///
539 /// Returns: the version of the receiver.
540 #[unsafe(method(version))]
541 #[unsafe(method_family = none)]
542 pub fn version(&self) -> NSUInteger;
543
544 #[cfg(feature = "NSString")]
545 /// Returns the name of the receiver.
546 ///
547 /// Returns: the name of the receiver.
548 #[unsafe(method(name))]
549 #[unsafe(method_family = none)]
550 pub fn name(&self) -> Retained<NSString>;
551
552 #[cfg(feature = "NSString")]
553 /// Returns the value of the receiver.
554 ///
555 /// Returns: the value of the receiver.
556 #[unsafe(method(value))]
557 #[unsafe(method_family = none)]
558 pub fn value(&self) -> Retained<NSString>;
559
560 #[cfg(feature = "NSDate")]
561 /// Returns the expires date of the receiver.
562 ///
563 /// Returns: the expires date of the receiver.
564 ///
565 /// The expires date is the date when the cookie should be
566 /// deleted. The result will be nil if there is no specific expires
567 /// date. This will be the case only for "session-only" cookies.
568 ///
569 /// Returns: The expires date of the receiver.
570 #[unsafe(method(expiresDate))]
571 #[unsafe(method_family = none)]
572 pub fn expiresDate(&self) -> Option<Retained<NSDate>>;
573
574 /// Returns whether the receiver is session-only.
575 ///
576 /// Returns: YES if this receiver should be discarded at the end of the
577 /// session (regardless of expiration date), NO if receiver need not
578 /// be discarded at the end of the session.
579 #[unsafe(method(isSessionOnly))]
580 #[unsafe(method_family = none)]
581 pub fn isSessionOnly(&self) -> bool;
582
583 #[cfg(feature = "NSString")]
584 /// Returns the domain of the receiver.
585 ///
586 /// This value specifies URL domain to which the cookie
587 /// should be sent. A domain with a leading dot means the cookie
588 /// should be sent to subdomains as well, assuming certain other
589 /// restrictions are valid. See RFC 2965 for more detail.
590 ///
591 /// Returns: The domain of the receiver.
592 #[unsafe(method(domain))]
593 #[unsafe(method_family = none)]
594 pub fn domain(&self) -> Retained<NSString>;
595
596 #[cfg(feature = "NSString")]
597 /// Returns the path of the receiver.
598 ///
599 /// This value specifies the URL path under the cookie's
600 /// domain for which this cookie should be sent. The cookie will also
601 /// be sent for children of that path, so "/" is the most general.
602 ///
603 /// Returns: The path of the receiver.
604 #[unsafe(method(path))]
605 #[unsafe(method_family = none)]
606 pub fn path(&self) -> Retained<NSString>;
607
608 /// Returns whether the receiver should be sent only over
609 /// secure channels
610 ///
611 /// Cookies may be marked secure by a server (or by a javascript).
612 /// Cookies marked as such must only be sent via an encrypted connection to
613 /// trusted servers (i.e. via SSL or TLS), and should not be delivered to any
614 /// javascript applications to prevent cross-site scripting vulnerabilities.
615 ///
616 /// Returns: YES if this cookie should be sent only over secure channels,
617 /// NO otherwise.
618 #[unsafe(method(isSecure))]
619 #[unsafe(method_family = none)]
620 pub fn isSecure(&self) -> bool;
621
622 /// Returns whether the receiver should only be sent to HTTP servers
623 /// per RFC 2965
624 ///
625 /// Cookies may be marked as HTTPOnly by a server (or by a javascript).
626 /// Cookies marked as such must only be sent via HTTP Headers in HTTP Requests
627 /// for URL's that match both the path and domain of the respective Cookies.
628 /// Specifically these cookies should not be delivered to any javascript
629 /// applications to prevent cross-site scripting vulnerabilities.
630 ///
631 /// Returns: YES if this cookie should only be sent via HTTP headers,
632 /// NO otherwise.
633 #[unsafe(method(isHTTPOnly))]
634 #[unsafe(method_family = none)]
635 pub fn isHTTPOnly(&self) -> bool;
636
637 #[cfg(feature = "NSString")]
638 /// Returns the comment of the receiver.
639 ///
640 /// This value specifies a string which is suitable for
641 /// presentation to the user explaining the contents and purpose of this
642 /// cookie. It may be nil.
643 ///
644 /// Returns: The comment of the receiver, or nil if the receiver has no
645 /// comment.
646 #[unsafe(method(comment))]
647 #[unsafe(method_family = none)]
648 pub fn comment(&self) -> Option<Retained<NSString>>;
649
650 #[cfg(feature = "NSURL")]
651 /// Returns the comment URL of the receiver.
652 ///
653 /// This value specifies a URL which is suitable for
654 /// presentation to the user as a link for further information about
655 /// this cookie. It may be nil.
656 ///
657 /// Returns: The comment URL of the receiver, or nil if the receiver
658 /// has no comment URL.
659 #[unsafe(method(commentURL))]
660 #[unsafe(method_family = none)]
661 pub fn commentURL(&self) -> Option<Retained<NSURL>>;
662
663 #[cfg(all(feature = "NSArray", feature = "NSValue"))]
664 /// Returns the list ports to which the receiver should be
665 /// sent.
666 ///
667 /// This value specifies an NSArray of NSNumbers
668 /// (containing integers) which specify the only ports to which this
669 /// cookie should be sent.
670 ///
671 /// Returns: The list ports to which the receiver should be sent. The
672 /// array may be nil, in which case this cookie can be sent to any
673 /// port.
674 #[unsafe(method(portList))]
675 #[unsafe(method_family = none)]
676 pub fn portList(&self) -> Option<Retained<NSArray<NSNumber>>>;
677
678 #[cfg(feature = "NSString")]
679 /// Returns the value of the same site attribute on the cookie.
680 ///
681 /// Cookies can be marked with an attribute Strict or Lax.
682 /// Cookies marked with "strict" (NSHTTPCookieSameSiteStrict) are not sent along with cross-site requests.
683 /// Cookies marked with "lax" (NSHTTPCookieSameSiteLax) sent along cross-site requests provided the
684 /// cross-site requests are top-level-requests (one that changes the url in the address bar).
685 /// The attribute value is canonicalized and stored. Any value other than the default (strict and lax) will be ignored.
686 ///
687 /// Returns: strict or lax. The result could also be nil, in which case the
688 /// cookie will be sent along with all cross-site requests.
689 #[unsafe(method(sameSitePolicy))]
690 #[unsafe(method_family = none)]
691 pub fn sameSitePolicy(&self) -> Option<Retained<NSHTTPCookieStringPolicy>>;
692 );
693}
694
695/// Methods declared on superclass `NSObject`.
696impl NSHTTPCookie {
697 extern_methods!(
698 #[unsafe(method(init))]
699 #[unsafe(method_family = init)]
700 pub fn init(this: Allocated<Self>) -> Retained<Self>;
701
702 #[unsafe(method(new))]
703 #[unsafe(method_family = new)]
704 pub fn new() -> Retained<Self>;
705 );
706}
707
708impl DefaultRetained for NSHTTPCookie {
709 #[inline]
710 fn default_retained() -> Retained<Self> {
711 Self::new()
712 }
713}