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
27extern_conformance!(
28    unsafe impl NSCopying for VZVirtioConsolePortConfigurationArray {}
29);
30
31unsafe impl CopyingHelper for VZVirtioConsolePortConfigurationArray {
32    type Result = Self;
33}
34
35extern_conformance!(
36    unsafe impl NSObjectProtocol for VZVirtioConsolePortConfigurationArray {}
37);
38
39impl VZVirtioConsolePortConfigurationArray {
40    extern_methods!(
41        #[unsafe(method(new))]
42        #[unsafe(method_family = new)]
43        pub unsafe fn new() -> Retained<Self>;
44
45        #[unsafe(method(init))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
48
49        /// The maximum number of ports allocated by this device. The default is the number of ports attached to this device.
50        #[unsafe(method(maximumPortCount))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn maximumPortCount(&self) -> u32;
53
54        /// Setter for [`maximumPortCount`][Self::maximumPortCount].
55        #[unsafe(method(setMaximumPortCount:))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn setMaximumPortCount(&self, maximum_port_count: u32);
58
59        #[cfg(all(
60            feature = "VZConsolePortConfiguration",
61            feature = "VZVirtioConsolePortConfiguration"
62        ))]
63        /// Get a port configuration at the specified index.
64        #[unsafe(method(objectAtIndexedSubscript:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn objectAtIndexedSubscript(
67            &self,
68            port_index: NSUInteger,
69        ) -> Option<Retained<VZVirtioConsolePortConfiguration>>;
70
71        #[cfg(all(
72            feature = "VZConsolePortConfiguration",
73            feature = "VZVirtioConsolePortConfiguration"
74        ))]
75        /// Set a port configuration at the specified index.
76        #[unsafe(method(setObject:atIndexedSubscript:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn setObject_atIndexedSubscript(
79            &self,
80            configuration: Option<&VZVirtioConsolePortConfiguration>,
81            port_index: NSUInteger,
82        );
83    );
84}