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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/belayerhierarchyhandle?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct BELayerHierarchyHandle;
);
unsafe impl Send for BELayerHierarchyHandle {}
unsafe impl Sync for BELayerHierarchyHandle {}
extern_conformance!(
unsafe impl NSCoding for BELayerHierarchyHandle {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for BELayerHierarchyHandle {}
);
extern_conformance!(
unsafe impl NSSecureCoding for BELayerHierarchyHandle {}
);
impl BELayerHierarchyHandle {
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>;
#[cfg(feature = "libc")]
/// Decodes a handle form a `mach_port_t` send right and its accompanying metadata.
/// - This method takes ownership of the port right (even if it returns an error).
#[unsafe(method(handleWithPort:data:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn handleWithPort_data_error(
port: libc::mach_port_t,
data: &NSData,
) -> Result<Retained<BELayerHierarchyHandle>, Retained<NSError>>;
#[cfg(all(feature = "block2", feature = "libc"))]
/// Encodes the handle into a `mach_port_t` send right and its accompanying metadata.
/// - The block is responsible for disposing of `copiedPort` - failure to manage its lifecycle will leak the port. Note that some functions (like ``handleWithPort:data:error:``) will assume control of the right for you.
/// - `copiedPort` will be `MACH_PORT_NULL` if the ``BELayerHierarchy`` pointed to by the handle is already invalidated.
/// - The port and data should ultimately be consumed together by ``handleWithPort:data:error:``.
#[unsafe(method(encodeWithBlock:))]
#[unsafe(method_family = none)]
pub unsafe fn encodeWithBlock(
&self,
block: &block2::DynBlock<dyn Fn(libc::mach_port_t, NonNull<NSData>) + '_>,
);
);
}