objc2_virtualization/generated/
VZVirtioConsolePortConfigurationArray.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    /// Virtio Console Port Configuration Array
12    ///
13    /// This array stores a collection of port configurations for a VZVirtioConsoleConfiguration. The index in the array corresponds to the port index used in the virtual machine.
14    ///
15    /// A maximumPortCount value may be set but must be larger than the highest indexed port. If no maximumPortCount value is set, the highest indexed port will be used.
16    ///
17    /// See: VZVirtioConsoleConfiguration
18    ///
19    /// See: VZVirtioConsolePortConfiguration
20    ///
21    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtioconsoleportconfigurationarray?language=objc)
22    #[unsafe(super(NSObject))]
23    #[derive(Debug, PartialEq, Eq, Hash)]
24    pub struct VZVirtioConsolePortConfigurationArray;
25);
26
27unsafe impl NSCopying for VZVirtioConsolePortConfigurationArray {}
28
29unsafe impl CopyingHelper for VZVirtioConsolePortConfigurationArray {
30    type Result = Self;
31}
32
33unsafe impl NSObjectProtocol for VZVirtioConsolePortConfigurationArray {}
34
35impl VZVirtioConsolePortConfigurationArray {
36    extern_methods!(
37        #[unsafe(method(new))]
38        #[unsafe(method_family = new)]
39        pub unsafe fn new() -> Retained<Self>;
40
41        #[unsafe(method(init))]
42        #[unsafe(method_family = init)]
43        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
44
45        /// The maximum number of ports allocated by this device. The default is the number of ports attached to this device.
46        #[unsafe(method(maximumPortCount))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn maximumPortCount(&self) -> u32;
49
50        /// Setter for [`maximumPortCount`][Self::maximumPortCount].
51        #[unsafe(method(setMaximumPortCount:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn setMaximumPortCount(&self, maximum_port_count: u32);
54
55        #[cfg(all(
56            feature = "VZConsolePortConfiguration",
57            feature = "VZVirtioConsolePortConfiguration"
58        ))]
59        /// Get a port configuration at the specified index.
60        #[unsafe(method(objectAtIndexedSubscript:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn objectAtIndexedSubscript(
63            &self,
64            port_index: NSUInteger,
65        ) -> Option<Retained<VZVirtioConsolePortConfiguration>>;
66
67        #[cfg(all(
68            feature = "VZConsolePortConfiguration",
69            feature = "VZVirtioConsolePortConfiguration"
70        ))]
71        /// Set a port configuration at the specified index.
72        #[unsafe(method(setObject:atIndexedSubscript:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn setObject_atIndexedSubscript(
75            &self,
76            configuration: Option<&VZVirtioConsolePortConfiguration>,
77            port_index: NSUInteger,
78        );
79    );
80}