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::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/belayerhierarchyhostingtransactioncoordinator?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct BELayerHierarchyHostingTransactionCoordinator;
);
unsafe impl Send for BELayerHierarchyHostingTransactionCoordinator {}
unsafe impl Sync for BELayerHierarchyHostingTransactionCoordinator {}
extern_conformance!(
unsafe impl NSCoding for BELayerHierarchyHostingTransactionCoordinator {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for BELayerHierarchyHostingTransactionCoordinator {}
);
extern_conformance!(
unsafe impl NSSecureCoding for BELayerHierarchyHostingTransactionCoordinator {}
);
impl BELayerHierarchyHostingTransactionCoordinator {
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>;
/// may fail if a connection to the render server cannot be established
#[unsafe(method(coordinatorWithError:_))]
#[unsafe(method_family = none)]
pub unsafe fn coordinatorWithError(
) -> Result<Retained<BELayerHierarchyHostingTransactionCoordinator>, Retained<NSError>>;
#[cfg(feature = "BELayerHierarchy")]
/// a signal to coordinate transactions involving `layerHierarchy` from now until `commit` is called
#[unsafe(method(addLayerHierarchy:))]
#[unsafe(method_family = none)]
pub unsafe fn addLayerHierarchy(&self, layer_hierarchy: &BELayerHierarchy);
#[cfg(feature = "BELayerHierarchyHostingView")]
/// a signal to coordinate transactions involving `hostingView` from now until `commit` is called
#[unsafe(method(addLayerHierarchyHostingView:))]
#[unsafe(method_family = none)]
pub unsafe fn addLayerHierarchyHostingView(
&self,
hosting_view: &BELayerHierarchyHostingView,
);
/// `commit` must be called on _every_ instance and it must be the last call to each instance.
/// note that it does not commit `CATransaction`s but rather commits the coordination of transactions in the render server.
/// note that coordinators should have as constrained a lifespan as possible and will timeout if held open too long.
#[unsafe(method(commit))]
#[unsafe(method_family = none)]
pub unsafe fn commit(&self, mtm: MainThreadMarker);
#[cfg(feature = "libc")]
/// Decodes a coordinator 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(coordinatorWithPort:data:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn coordinatorWithPort_data_error(
port: libc::mach_port_t,
data: &NSData,
) -> Result<Retained<BELayerHierarchyHostingTransactionCoordinator>, Retained<NSError>>;
#[cfg(all(feature = "block2", feature = "libc"))]
/// Encodes the coordinator 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 ``coordinatorWithPort:data:error:``) will assume control of the right for you.
/// - `copiedPort` will be `MACH_PORT_NULL` if the receiver is already invalidated.
/// - The port and data should ultimately be consumed together and _only_ once by ``coordinatorWithPort: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>) + '_>,
);
);
}