objc2_browser_engine_kit/generated/
BELayerHierarchyHandle.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/belayerhierarchyhandle?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct BELayerHierarchyHandle;
15);
16
17unsafe impl Send for BELayerHierarchyHandle {}
18
19unsafe impl Sync for BELayerHierarchyHandle {}
20
21extern_conformance!(
22    unsafe impl NSCoding for BELayerHierarchyHandle {}
23);
24
25extern_conformance!(
26    unsafe impl NSObjectProtocol for BELayerHierarchyHandle {}
27);
28
29extern_conformance!(
30    unsafe impl NSSecureCoding for BELayerHierarchyHandle {}
31);
32
33impl BELayerHierarchyHandle {
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        #[cfg(feature = "libc")]
44        /// Decodes a handle form a `mach_port_t` send right and its accompanying metadata.
45        /// - This method takes ownership of the port right (even if it returns an error).
46        #[unsafe(method(handleWithPort:data:error:_))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn handleWithPort_data_error(
49            port: libc::mach_port_t,
50            data: &NSData,
51        ) -> Result<Retained<BELayerHierarchyHandle>, Retained<NSError>>;
52
53        #[cfg(all(feature = "block2", feature = "libc"))]
54        /// Encodes the handle into a `mach_port_t` send right and its accompanying metadata.
55        /// - 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.
56        /// - `copiedPort` will be `MACH_PORT_NULL` if the ``BELayerHierarchy`` pointed to by the handle is already invalidated.
57        /// - The port and data should ultimately be consumed together  by ``handleWithPort:data:error:``.
58        #[unsafe(method(encodeWithBlock:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn encodeWithBlock(
61            &self,
62            block: &block2::DynBlock<dyn Fn(libc::mach_port_t, NonNull<NSData>) + '_>,
63        );
64    );
65}