1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// A WebResource represents a fully downloaded URL.
/// It includes the data of the resource as well as the metadata associated with the resource.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webresource?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct WebResource;
);
unsafe impl NSCoding for WebResource {}
unsafe impl NSCopying for WebResource {}
unsafe impl CopyingHelper for WebResource {
type Result = Self;
}
unsafe impl NSObjectProtocol for WebResource {}
impl WebResource {
extern_methods!(
/// The initializer for WebResource.
///
/// Parameter `data`: The data of the resource.
///
/// Parameter `URL`: The URL of the resource.
///
/// Parameter `MIMEType`: The MIME type of the resource.
///
/// Parameter `textEncodingName`: The text encoding name of the resource (can be nil).
///
/// Parameter `frameName`: The frame name of the resource if the resource represents the contents of an entire HTML frame (can be nil).
///
/// Returns: An initialized WebResource.
#[unsafe(method(initWithData:URL:MIMEType:textEncodingName:frameName:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithData_URL_MIMEType_textEncodingName_frameName(
this: Allocated<Self>,
data: Option<&NSData>,
url: Option<&NSURL>,
mime_type: Option<&NSString>,
text_encoding_name: Option<&NSString>,
frame_name: Option<&NSString>,
) -> Option<Retained<Self>>;
/// The data of the resource.
#[unsafe(method(data))]
#[unsafe(method_family = none)]
pub unsafe fn data(&self) -> Retained<NSData>;
/// The URL of the resource.
#[unsafe(method(URL))]
#[unsafe(method_family = none)]
pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
/// The MIME type of the resource.
#[unsafe(method(MIMEType))]
#[unsafe(method_family = none)]
pub unsafe fn MIMEType(&self) -> Retained<NSString>;
/// The text encoding name of the resource (can be nil).
#[unsafe(method(textEncodingName))]
#[unsafe(method_family = none)]
pub unsafe fn textEncodingName(&self) -> Retained<NSString>;
/// The frame name of the resource if the resource represents the contents of an entire HTML frame (can be nil).
#[unsafe(method(frameName))]
#[unsafe(method_family = none)]
pub unsafe fn frameName(&self) -> Retained<NSString>;
);
}
/// Methods declared on superclass `NSObject`.
impl WebResource {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}