objc2_open_directory/generated/
ODModuleEntry.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/opendirectory/odmoduleentry?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct ODModuleEntry;
15);
16
17extern_conformance!(
18    unsafe impl NSObjectProtocol for ODModuleEntry {}
19);
20
21impl ODModuleEntry {
22    extern_methods!(
23        #[cfg(feature = "ODMappings")]
24        #[unsafe(method(mappings))]
25        #[unsafe(method_family = none)]
26        pub unsafe fn mappings(&self) -> Option<Retained<ODMappings>>;
27
28        #[cfg(feature = "ODMappings")]
29        /// Setter for [`mappings`][Self::mappings].
30        ///
31        /// # Safety
32        ///
33        /// `mappings` might not allow `None`.
34        #[unsafe(method(setMappings:))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn setMappings(&self, mappings: Option<&ODMappings>);
37
38        #[unsafe(method(supportedOptions))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn supportedOptions(&self) -> Retained<NSArray>;
41
42        #[unsafe(method(name))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn name(&self) -> Retained<NSString>;
45
46        /// Setter for [`name`][Self::name].
47        ///
48        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
49        #[unsafe(method(setName:))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn setName(&self, name: Option<&NSString>);
52
53        #[unsafe(method(xpcServiceName))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn xpcServiceName(&self) -> Retained<NSString>;
56
57        /// Setter for [`xpcServiceName`][Self::xpcServiceName].
58        ///
59        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
60        #[unsafe(method(setXpcServiceName:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn setXpcServiceName(&self, xpc_service_name: Option<&NSString>);
63
64        #[unsafe(method(uuidString))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn uuidString(&self) -> Retained<NSString>;
67
68        /// Setter for [`uuidString`][Self::uuidString].
69        ///
70        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
71        #[unsafe(method(setUuidString:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn setUuidString(&self, uuid_string: Option<&NSString>);
74
75        /// Creates a new module entry with a given name and service.
76        ///
77        ///
78        /// Creates a new module entry with a given name and service.
79        ///
80        /// # Safety
81        ///
82        /// - `name` might not allow `None`.
83        /// - `xpc_service_name` might not allow `None`.
84        #[unsafe(method(moduleEntryWithName:xpcServiceName:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn moduleEntryWithName_xpcServiceName(
87            name: Option<&NSString>,
88            xpc_service_name: Option<&NSString>,
89        ) -> Option<Retained<Self>>;
90
91        /// Assigns a particular option for this module.
92        ///
93        ///
94        /// Options are dictated by the module and can be queried via [module supportedOptions].
95        ///
96        /// # Safety
97        ///
98        /// - `option_name` might not allow `None`.
99        /// - `value` should be of the correct type.
100        /// - `value` might not allow `None`.
101        #[unsafe(method(setOption:value:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn setOption_value(
104            &self,
105            option_name: Option<&NSString>,
106            value: Option<&AnyObject>,
107        );
108
109        /// Fetches the current setting for the requested option.
110        ///
111        ///
112        /// Fetches the current setting for the requested option.
113        ///
114        /// # Safety
115        ///
116        /// `option_name` might not allow `None`.
117        #[unsafe(method(option:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn option(&self, option_name: Option<&NSString>) -> Option<Retained<AnyObject>>;
120    );
121}
122
123/// Methods declared on superclass `NSObject`.
124impl ODModuleEntry {
125    extern_methods!(
126        #[unsafe(method(init))]
127        #[unsafe(method_family = init)]
128        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
129
130        #[unsafe(method(new))]
131        #[unsafe(method_family = new)]
132        pub unsafe fn new() -> Retained<Self>;
133    );
134}