objc2_browser_engine_kit/generated/
BELayerHierarchyHostingTransactionCoordinator.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/belayerhierarchyhostingtransactioncoordinator?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct BELayerHierarchyHostingTransactionCoordinator;
15);
16
17unsafe impl Send for BELayerHierarchyHostingTransactionCoordinator {}
18
19unsafe impl Sync for BELayerHierarchyHostingTransactionCoordinator {}
20
21extern_conformance!(
22    unsafe impl NSCoding for BELayerHierarchyHostingTransactionCoordinator {}
23);
24
25extern_conformance!(
26    unsafe impl NSObjectProtocol for BELayerHierarchyHostingTransactionCoordinator {}
27);
28
29extern_conformance!(
30    unsafe impl NSSecureCoding for BELayerHierarchyHostingTransactionCoordinator {}
31);
32
33impl BELayerHierarchyHostingTransactionCoordinator {
34    extern_methods!(
35        #[unsafe(method(init))]
36        #[unsafe(method_family = init)]
37        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
38
39        #[unsafe(method(new))]
40        #[unsafe(method_family = new)]
41        pub unsafe fn new() -> Retained<Self>;
42
43        /// may fail if a connection to the render server cannot be established
44        #[unsafe(method(coordinatorWithError:_))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn coordinatorWithError(
47        ) -> Result<Retained<BELayerHierarchyHostingTransactionCoordinator>, Retained<NSError>>;
48
49        #[cfg(feature = "BELayerHierarchy")]
50        /// a signal to coordinate transactions involving `layerHierarchy` from now until `commit` is called
51        #[unsafe(method(addLayerHierarchy:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn addLayerHierarchy(&self, layer_hierarchy: &BELayerHierarchy);
54
55        #[cfg(feature = "BELayerHierarchyHostingView")]
56        /// a signal to coordinate transactions involving `hostingView` from now until `commit` is called
57        #[unsafe(method(addLayerHierarchyHostingView:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn addLayerHierarchyHostingView(
60            &self,
61            hosting_view: &BELayerHierarchyHostingView,
62        );
63
64        /// `commit` must be called on _every_ instance and it must be the last call to each instance.
65        /// note that it does not commit `CATransaction`s but rather commits the coordination of transactions in the render server.
66        /// note that coordinators should have as constrained a lifespan as possible and will timeout if held open too long.
67        #[unsafe(method(commit))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn commit(&self, mtm: MainThreadMarker);
70
71        #[cfg(feature = "libc")]
72        /// Decodes a coordinator form a `mach_port_t` send right and its accompanying metadata.
73        /// - This method takes ownership of the port right (even if it returns an error).
74        #[unsafe(method(coordinatorWithPort:data:error:_))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn coordinatorWithPort_data_error(
77            port: libc::mach_port_t,
78            data: &NSData,
79        ) -> Result<Retained<BELayerHierarchyHostingTransactionCoordinator>, Retained<NSError>>;
80
81        #[cfg(all(feature = "block2", feature = "libc"))]
82        /// Encodes the coordinator into a `mach_port_t` send right and its accompanying metadata.
83        /// - 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.
84        /// - `copiedPort` will be `MACH_PORT_NULL` if the receiver is already invalidated.
85        /// - The port and data should ultimately be consumed together and _only_ once by ``coordinatorWithPort:data:error:``.
86        #[unsafe(method(encodeWithBlock:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn encodeWithBlock(
89            &self,
90            block: &block2::DynBlock<dyn Fn(libc::mach_port_t, NonNull<NSData>) + '_>,
91        );
92    );
93}