objc2_av_foundation/generated/
AVAssetDownloadTask.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-media")]
7use objc2_core_media::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern "C" {
13 pub static AVAssetDownloadTaskMinimumRequiredMediaBitrateKey: &'static NSString;
20}
21
22extern "C" {
23 pub static AVAssetDownloadTaskMinimumRequiredPresentationSizeKey: &'static NSString;
30}
31
32extern "C" {
33 pub static AVAssetDownloadTaskMediaSelectionKey: &'static NSString;
40}
41
42extern "C" {
43 pub static AVAssetDownloadTaskMediaSelectionPrefersMultichannelKey: &'static NSString;
50}
51
52extern "C" {
53 pub static AVAssetDownloadTaskPrefersLosslessAudioKey: &'static NSString;
60}
61
62extern "C" {
63 pub static AVAssetDownloadTaskPrefersHDRKey: &'static NSString;
70}
71
72extern_class!(
73 #[unsafe(super(NSURLSessionTask, NSObject))]
79 #[derive(Debug, PartialEq, Eq, Hash)]
80 pub struct AVAssetDownloadTask;
81);
82
83unsafe impl NSCopying for AVAssetDownloadTask {}
84
85unsafe impl CopyingHelper for AVAssetDownloadTask {
86 type Result = Self;
87}
88
89unsafe impl NSObjectProtocol for AVAssetDownloadTask {}
90
91unsafe impl NSProgressReporting for AVAssetDownloadTask {}
92
93impl AVAssetDownloadTask {
94 extern_methods!(
95 #[cfg(feature = "AVAsset")]
96 #[unsafe(method(URLAsset))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn URLAsset(&self) -> Retained<AVURLAsset>;
100
101 #[deprecated = "Use the URL property of URLAsset instead"]
105 #[unsafe(method(destinationURL))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn destinationURL(&self) -> Retained<NSURL>;
108
109 #[deprecated = "Use AVAssetDownloadConfiguration instead"]
111 #[unsafe(method(options))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn options(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
114
115 #[deprecated = "Use NSURLSessionTask.progress instead"]
119 #[unsafe(method(loadedTimeRanges))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn loadedTimeRanges(&self) -> Retained<NSArray<NSValue>>;
122
123 #[unsafe(method(init))]
124 #[unsafe(method_family = init)]
125 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
126
127 #[unsafe(method(new))]
128 #[unsafe(method_family = new)]
129 pub unsafe fn new() -> Retained<Self>;
130
131 #[unsafe(method(originalRequest))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn originalRequest(&self) -> Retained<NSURLRequest>;
134
135 #[unsafe(method(currentRequest))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn currentRequest(&self) -> Retained<NSURLRequest>;
138
139 #[unsafe(method(response))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn response(&self) -> Retained<NSURLResponse>;
142 );
143}
144
145extern_class!(
146 #[unsafe(super(NSObject))]
155 #[derive(Debug, PartialEq, Eq, Hash)]
156 pub struct AVAssetDownloadConfiguration;
157);
158
159unsafe impl NSObjectProtocol for AVAssetDownloadConfiguration {}
160
161impl AVAssetDownloadConfiguration {
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 #[cfg(feature = "AVAsset")]
172 #[unsafe(method(downloadConfigurationWithAsset:title:))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn downloadConfigurationWithAsset_title(
182 asset: &AVURLAsset,
183 title: &NSString,
184 ) -> Retained<Self>;
185
186 #[unsafe(method(artworkData))]
188 #[unsafe(method_family = none)]
189 pub unsafe fn artworkData(&self) -> Option<Retained<NSData>>;
190
191 #[unsafe(method(setArtworkData:))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn setArtworkData(&self, artwork_data: Option<&NSData>);
195
196 #[unsafe(method(primaryContentConfiguration))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn primaryContentConfiguration(
200 &self,
201 ) -> Retained<AVAssetDownloadContentConfiguration>;
202
203 #[unsafe(method(auxiliaryContentConfigurations))]
207 #[unsafe(method_family = none)]
208 pub unsafe fn auxiliaryContentConfigurations(
209 &self,
210 ) -> Retained<NSArray<AVAssetDownloadContentConfiguration>>;
211
212 #[unsafe(method(setAuxiliaryContentConfigurations:))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn setAuxiliaryContentConfigurations(
216 &self,
217 auxiliary_content_configurations: &NSArray<AVAssetDownloadContentConfiguration>,
218 );
219
220 #[unsafe(method(optimizesAuxiliaryContentConfigurations))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn optimizesAuxiliaryContentConfigurations(&self) -> bool;
226
227 #[unsafe(method(setOptimizesAuxiliaryContentConfigurations:))]
229 #[unsafe(method_family = none)]
230 pub unsafe fn setOptimizesAuxiliaryContentConfigurations(
231 &self,
232 optimizes_auxiliary_content_configurations: bool,
233 );
234
235 #[unsafe(method(downloadsInterstitialAssets))]
239 #[unsafe(method_family = none)]
240 pub unsafe fn downloadsInterstitialAssets(&self) -> bool;
241
242 #[unsafe(method(setDownloadsInterstitialAssets:))]
244 #[unsafe(method_family = none)]
245 pub unsafe fn setDownloadsInterstitialAssets(&self, downloads_interstitial_assets: bool);
246 );
247}
248
249extern_class!(
250 #[unsafe(super(NSObject))]
254 #[derive(Debug, PartialEq, Eq, Hash)]
255 pub struct AVAssetDownloadContentConfiguration;
256);
257
258unsafe impl NSCopying for AVAssetDownloadContentConfiguration {}
259
260unsafe impl CopyingHelper for AVAssetDownloadContentConfiguration {
261 type Result = Self;
262}
263
264unsafe impl NSObjectProtocol for AVAssetDownloadContentConfiguration {}
265
266impl AVAssetDownloadContentConfiguration {
267 extern_methods!(
268 #[cfg(feature = "AVAssetVariant")]
269 #[unsafe(method(variantQualifiers))]
275 #[unsafe(method_family = none)]
276 pub unsafe fn variantQualifiers(&self) -> Retained<NSArray<AVAssetVariantQualifier>>;
277
278 #[cfg(feature = "AVAssetVariant")]
279 #[unsafe(method(setVariantQualifiers:))]
281 #[unsafe(method_family = none)]
282 pub unsafe fn setVariantQualifiers(
283 &self,
284 variant_qualifiers: &NSArray<AVAssetVariantQualifier>,
285 );
286
287 #[cfg(feature = "AVMediaSelection")]
288 #[unsafe(method(mediaSelections))]
292 #[unsafe(method_family = none)]
293 pub unsafe fn mediaSelections(&self) -> Retained<NSArray<AVMediaSelection>>;
294
295 #[cfg(feature = "AVMediaSelection")]
296 #[unsafe(method(setMediaSelections:))]
298 #[unsafe(method_family = none)]
299 pub unsafe fn setMediaSelections(&self, media_selections: &NSArray<AVMediaSelection>);
300 );
301}
302
303impl AVAssetDownloadContentConfiguration {
305 extern_methods!(
306 #[unsafe(method(init))]
307 #[unsafe(method_family = init)]
308 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
309
310 #[unsafe(method(new))]
311 #[unsafe(method_family = new)]
312 pub unsafe fn new() -> Retained<Self>;
313 );
314}
315
316extern_class!(
317 #[unsafe(super(NSURLSessionTask, NSObject))]
325 #[derive(Debug, PartialEq, Eq, Hash)]
326 #[deprecated = "Use assetDownloadTaskWithConfiguration: instead"]
327 pub struct AVAggregateAssetDownloadTask;
328);
329
330unsafe impl NSCopying for AVAggregateAssetDownloadTask {}
331
332unsafe impl CopyingHelper for AVAggregateAssetDownloadTask {
333 type Result = Self;
334}
335
336unsafe impl NSObjectProtocol for AVAggregateAssetDownloadTask {}
337
338unsafe impl NSProgressReporting for AVAggregateAssetDownloadTask {}
339
340impl AVAggregateAssetDownloadTask {
341 extern_methods!(
342 #[cfg(feature = "AVAsset")]
343 #[deprecated = "Use assetDownloadTaskWithConfiguration: instead"]
345 #[unsafe(method(URLAsset))]
346 #[unsafe(method_family = none)]
347 pub unsafe fn URLAsset(&self) -> Retained<AVURLAsset>;
348
349 #[deprecated = "Use assetDownloadTaskWithConfiguration: instead"]
350 #[unsafe(method(init))]
351 #[unsafe(method_family = init)]
352 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
353
354 #[deprecated = "Use assetDownloadTaskWithConfiguration: instead"]
355 #[unsafe(method(new))]
356 #[unsafe(method_family = new)]
357 pub unsafe fn new() -> Retained<Self>;
358
359 #[deprecated = "Use assetDownloadTaskWithConfiguration: instead"]
360 #[unsafe(method(originalRequest))]
361 #[unsafe(method_family = none)]
362 pub unsafe fn originalRequest(&self) -> Retained<NSURLRequest>;
363
364 #[deprecated = "Use assetDownloadTaskWithConfiguration: instead"]
365 #[unsafe(method(currentRequest))]
366 #[unsafe(method_family = none)]
367 pub unsafe fn currentRequest(&self) -> Retained<NSURLRequest>;
368
369 #[deprecated = "Use assetDownloadTaskWithConfiguration: instead"]
370 #[unsafe(method(response))]
371 #[unsafe(method_family = none)]
372 pub unsafe fn response(&self) -> Retained<NSURLResponse>;
373 );
374}
375
376extern_protocol!(
377 pub unsafe trait AVAssetDownloadDelegate: NSURLSessionTaskDelegate {
382 #[deprecated = "Use URLSession:assetDownloadTask:willDownloadToURL: instead"]
392 #[optional]
393 #[unsafe(method(URLSession:assetDownloadTask:didFinishDownloadingToURL:))]
394 #[unsafe(method_family = none)]
395 unsafe fn URLSession_assetDownloadTask_didFinishDownloadingToURL(
396 &self,
397 session: &NSURLSession,
398 asset_download_task: &AVAssetDownloadTask,
399 location: &NSURL,
400 );
401
402 #[cfg(feature = "objc2-core-media")]
403 #[deprecated = "Use NSURLSessionTask.progress instead"]
415 #[optional]
416 #[unsafe(method(URLSession:assetDownloadTask:didLoadTimeRange:totalTimeRangesLoaded:timeRangeExpectedToLoad:))]
417 #[unsafe(method_family = none)]
418 unsafe fn URLSession_assetDownloadTask_didLoadTimeRange_totalTimeRangesLoaded_timeRangeExpectedToLoad(
419 &self,
420 session: &NSURLSession,
421 asset_download_task: &AVAssetDownloadTask,
422 time_range: CMTimeRange,
423 loaded_time_ranges: &NSArray<NSValue>,
424 time_range_expected_to_load: CMTimeRange,
425 );
426
427 #[cfg(feature = "AVMediaSelection")]
428 #[optional]
429 #[unsafe(method(URLSession:assetDownloadTask:didResolveMediaSelection:))]
430 #[unsafe(method_family = none)]
431 unsafe fn URLSession_assetDownloadTask_didResolveMediaSelection(
432 &self,
433 session: &NSURLSession,
434 asset_download_task: &AVAssetDownloadTask,
435 resolved_media_selection: &AVMediaSelection,
436 );
437
438 #[optional]
439 #[unsafe(method(URLSession:assetDownloadTask:willDownloadToURL:))]
440 #[unsafe(method_family = none)]
441 unsafe fn URLSession_assetDownloadTask_willDownloadToURL(
442 &self,
443 session: &NSURLSession,
444 asset_download_task: &AVAssetDownloadTask,
445 location: &NSURL,
446 );
447
448 #[deprecated = "Use URLSession:assetDownloadTask:willDownloadToURL: instead"]
449 #[optional]
450 #[unsafe(method(URLSession:aggregateAssetDownloadTask:willDownloadToURL:))]
451 #[unsafe(method_family = none)]
452 unsafe fn URLSession_aggregateAssetDownloadTask_willDownloadToURL(
453 &self,
454 session: &NSURLSession,
455 aggregate_asset_download_task: &AVAggregateAssetDownloadTask,
456 location: &NSURL,
457 );
458
459 #[cfg(feature = "AVMediaSelection")]
460 #[deprecated = "Use the NSURLSessionDownloadDelegate method instead, URLSession:task:didCompleteWithError:"]
461 #[optional]
462 #[unsafe(method(URLSession:aggregateAssetDownloadTask:didCompleteForMediaSelection:))]
463 #[unsafe(method_family = none)]
464 unsafe fn URLSession_aggregateAssetDownloadTask_didCompleteForMediaSelection(
465 &self,
466 session: &NSURLSession,
467 aggregate_asset_download_task: &AVAggregateAssetDownloadTask,
468 media_selection: &AVMediaSelection,
469 );
470
471 #[cfg(all(feature = "AVMediaSelection", feature = "objc2-core-media"))]
472 #[deprecated = "Use NSURLSessionTask.progress: instead"]
473 #[optional]
474 #[unsafe(method(URLSession:aggregateAssetDownloadTask:didLoadTimeRange:totalTimeRangesLoaded:timeRangeExpectedToLoad:forMediaSelection:))]
475 #[unsafe(method_family = none)]
476 unsafe fn URLSession_aggregateAssetDownloadTask_didLoadTimeRange_totalTimeRangesLoaded_timeRangeExpectedToLoad_forMediaSelection(
477 &self,
478 session: &NSURLSession,
479 aggregate_asset_download_task: &AVAggregateAssetDownloadTask,
480 time_range: CMTimeRange,
481 loaded_time_ranges: &NSArray<NSValue>,
482 time_range_expected_to_load: CMTimeRange,
483 media_selection: &AVMediaSelection,
484 );
485
486 #[cfg(feature = "AVAssetVariant")]
487 #[optional]
495 #[unsafe(method(URLSession:assetDownloadTask:willDownloadVariants:))]
496 #[unsafe(method_family = none)]
497 unsafe fn URLSession_assetDownloadTask_willDownloadVariants(
498 &self,
499 session: &NSURLSession,
500 asset_download_task: &AVAssetDownloadTask,
501 variants: &NSArray<AVAssetVariant>,
502 );
503 }
504);
505
506extern_class!(
507 #[unsafe(super(NSURLSession, NSObject))]
511 #[derive(Debug, PartialEq, Eq, Hash)]
512 pub struct AVAssetDownloadURLSession;
513);
514
515unsafe impl NSObjectProtocol for AVAssetDownloadURLSession {}
516
517impl AVAssetDownloadURLSession {
518 extern_methods!(
519 #[unsafe(method(sessionWithConfiguration:assetDownloadDelegate:delegateQueue:))]
527 #[unsafe(method_family = none)]
528 pub unsafe fn sessionWithConfiguration_assetDownloadDelegate_delegateQueue(
529 configuration: &NSURLSessionConfiguration,
530 delegate: Option<&ProtocolObject<dyn AVAssetDownloadDelegate>>,
531 delegate_queue: Option<&NSOperationQueue>,
532 ) -> Retained<AVAssetDownloadURLSession>;
533
534 #[cfg(feature = "AVAsset")]
535 #[deprecated = "Use assetDownloadTaskWithURLAsset:assetTitle:assetArtworkData:options: instead"]
545 #[unsafe(method(assetDownloadTaskWithURLAsset:destinationURL:options:))]
546 #[unsafe(method_family = none)]
547 pub unsafe fn assetDownloadTaskWithURLAsset_destinationURL_options(
548 &self,
549 url_asset: &AVURLAsset,
550 destination_url: &NSURL,
551 options: Option<&NSDictionary<NSString, AnyObject>>,
552 ) -> Option<Retained<AVAssetDownloadTask>>;
553
554 #[cfg(feature = "AVAsset")]
555 #[deprecated = "Use assetDownloadTaskWithConfiguration: instead"]
567 #[unsafe(method(assetDownloadTaskWithURLAsset:assetTitle:assetArtworkData:options:))]
568 #[unsafe(method_family = none)]
569 pub unsafe fn assetDownloadTaskWithURLAsset_assetTitle_assetArtworkData_options(
570 &self,
571 url_asset: &AVURLAsset,
572 title: &NSString,
573 artwork_data: Option<&NSData>,
574 options: Option<&NSDictionary<NSString, AnyObject>>,
575 ) -> Option<Retained<AVAssetDownloadTask>>;
576
577 #[cfg(all(feature = "AVAsset", feature = "AVMediaSelection"))]
578 #[deprecated = "Use assetDownloadTaskWithConfiguration: instead"]
592 #[unsafe(method(aggregateAssetDownloadTaskWithURLAsset:mediaSelections:assetTitle:assetArtworkData:options:))]
593 #[unsafe(method_family = none)]
594 pub unsafe fn aggregateAssetDownloadTaskWithURLAsset_mediaSelections_assetTitle_assetArtworkData_options(
595 &self,
596 url_asset: &AVURLAsset,
597 media_selections: &NSArray<AVMediaSelection>,
598 title: &NSString,
599 artwork_data: Option<&NSData>,
600 options: Option<&NSDictionary<NSString, AnyObject>>,
601 ) -> Option<Retained<AVAggregateAssetDownloadTask>>;
602
603 #[unsafe(method(assetDownloadTaskWithConfiguration:))]
609 #[unsafe(method_family = none)]
610 pub unsafe fn assetDownloadTaskWithConfiguration(
611 &self,
612 download_configuration: &AVAssetDownloadConfiguration,
613 ) -> Retained<AVAssetDownloadTask>;
614
615 #[unsafe(method(init))]
616 #[unsafe(method_family = init)]
617 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
618
619 #[unsafe(method(new))]
620 #[unsafe(method_family = new)]
621 pub unsafe fn new() -> Retained<Self>;
622
623 #[unsafe(method(sharedSession))]
624 #[unsafe(method_family = none)]
625 pub unsafe fn sharedSession() -> Retained<NSURLSession>;
626
627 #[unsafe(method(sessionWithConfiguration:))]
628 #[unsafe(method_family = none)]
629 pub unsafe fn sessionWithConfiguration(
630 configuration: &NSURLSessionConfiguration,
631 ) -> Retained<NSURLSession>;
632
633 #[unsafe(method(sessionWithConfiguration:delegate:delegateQueue:))]
634 #[unsafe(method_family = none)]
635 pub unsafe fn sessionWithConfiguration_delegate_delegateQueue(
636 configuration: &NSURLSessionConfiguration,
637 delegate: Option<&ProtocolObject<dyn NSURLSessionDelegate>>,
638 queue: Option<&NSOperationQueue>,
639 ) -> Retained<NSURLSession>;
640
641 #[unsafe(method(dataTaskWithRequest:))]
642 #[unsafe(method_family = none)]
643 pub unsafe fn dataTaskWithRequest(
644 &self,
645 request: &NSURLRequest,
646 ) -> Retained<NSURLSessionDataTask>;
647
648 #[unsafe(method(dataTaskWithURL:))]
649 #[unsafe(method_family = none)]
650 pub unsafe fn dataTaskWithURL(&self, url: &NSURL) -> Retained<NSURLSessionDataTask>;
651
652 #[unsafe(method(uploadTaskWithRequest:fromFile:))]
653 #[unsafe(method_family = none)]
654 pub unsafe fn uploadTaskWithRequest_fromFile(
655 &self,
656 request: &NSURLRequest,
657 file_url: &NSURL,
658 ) -> Retained<NSURLSessionUploadTask>;
659
660 #[unsafe(method(uploadTaskWithRequest:fromData:))]
661 #[unsafe(method_family = none)]
662 pub unsafe fn uploadTaskWithRequest_fromData(
663 &self,
664 request: &NSURLRequest,
665 body_data: &NSData,
666 ) -> Retained<NSURLSessionUploadTask>;
667
668 #[unsafe(method(uploadTaskWithStreamedRequest:))]
669 #[unsafe(method_family = none)]
670 pub unsafe fn uploadTaskWithStreamedRequest(
671 &self,
672 request: &NSURLRequest,
673 ) -> Retained<NSURLSessionUploadTask>;
674
675 #[unsafe(method(downloadTaskWithRequest:))]
676 #[unsafe(method_family = none)]
677 pub unsafe fn downloadTaskWithRequest(
678 &self,
679 request: &NSURLRequest,
680 ) -> Retained<NSURLSessionDownloadTask>;
681
682 #[unsafe(method(downloadTaskWithURL:))]
683 #[unsafe(method_family = none)]
684 pub unsafe fn downloadTaskWithURL(&self, url: &NSURL)
685 -> Retained<NSURLSessionDownloadTask>;
686
687 #[unsafe(method(downloadTaskWithResumeData:))]
688 #[unsafe(method_family = none)]
689 pub unsafe fn downloadTaskWithResumeData(
690 &self,
691 resume_data: &NSData,
692 ) -> Retained<NSURLSessionDownloadTask>;
693
694 #[cfg(feature = "block2")]
695 #[unsafe(method(dataTaskWithRequest:completionHandler:))]
696 #[unsafe(method_family = none)]
697 pub unsafe fn dataTaskWithRequest_completionHandler(
698 &self,
699 request: &NSURLRequest,
700 completion_handler: &block2::Block<
701 dyn Fn(NonNull<NSData>, NonNull<NSURLResponse>, NonNull<NSError>),
702 >,
703 ) -> Retained<NSURLSessionDataTask>;
704
705 #[cfg(feature = "block2")]
706 #[unsafe(method(dataTaskWithURL:completionHandler:))]
707 #[unsafe(method_family = none)]
708 pub unsafe fn dataTaskWithURL_completionHandler(
709 &self,
710 url: &NSURL,
711 completion_handler: &block2::Block<
712 dyn Fn(NonNull<NSData>, NonNull<NSURLResponse>, NonNull<NSError>),
713 >,
714 ) -> Retained<NSURLSessionDataTask>;
715
716 #[cfg(feature = "block2")]
717 #[unsafe(method(uploadTaskWithRequest:fromFile:completionHandler:))]
718 #[unsafe(method_family = none)]
719 pub unsafe fn uploadTaskWithRequest_fromFile_completionHandler(
720 &self,
721 request: &NSURLRequest,
722 file_url: &NSURL,
723 completion_handler: &block2::Block<
724 dyn Fn(NonNull<NSData>, NonNull<NSURLResponse>, NonNull<NSError>),
725 >,
726 ) -> Retained<NSURLSessionUploadTask>;
727
728 #[cfg(feature = "block2")]
729 #[unsafe(method(uploadTaskWithRequest:fromData:completionHandler:))]
730 #[unsafe(method_family = none)]
731 pub unsafe fn uploadTaskWithRequest_fromData_completionHandler(
732 &self,
733 request: &NSURLRequest,
734 body_data: Option<&NSData>,
735 completion_handler: &block2::Block<
736 dyn Fn(NonNull<NSData>, NonNull<NSURLResponse>, NonNull<NSError>),
737 >,
738 ) -> Retained<NSURLSessionUploadTask>;
739
740 #[cfg(feature = "block2")]
741 #[unsafe(method(downloadTaskWithRequest:completionHandler:))]
742 #[unsafe(method_family = none)]
743 pub unsafe fn downloadTaskWithRequest_completionHandler(
744 &self,
745 request: &NSURLRequest,
746 completion_handler: &block2::Block<
747 dyn Fn(NonNull<NSURL>, NonNull<NSURLResponse>, NonNull<NSError>),
748 >,
749 ) -> Retained<NSURLSessionDownloadTask>;
750
751 #[cfg(feature = "block2")]
752 #[unsafe(method(downloadTaskWithURL:completionHandler:))]
753 #[unsafe(method_family = none)]
754 pub unsafe fn downloadTaskWithURL_completionHandler(
755 &self,
756 url: &NSURL,
757 completion_handler: &block2::Block<
758 dyn Fn(NonNull<NSURL>, NonNull<NSURLResponse>, NonNull<NSError>),
759 >,
760 ) -> Retained<NSURLSessionDownloadTask>;
761
762 #[cfg(feature = "block2")]
763 #[unsafe(method(downloadTaskWithResumeData:completionHandler:))]
764 #[unsafe(method_family = none)]
765 pub unsafe fn downloadTaskWithResumeData_completionHandler(
766 &self,
767 resume_data: &NSData,
768 completion_handler: &block2::Block<
769 dyn Fn(NonNull<NSURL>, NonNull<NSURLResponse>, NonNull<NSError>),
770 >,
771 ) -> Retained<NSURLSessionDownloadTask>;
772 );
773}