objc2_virtualization/generated/
VZVirtioConsolePortConfiguration.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
12    ///
13    /// A console port is a two-way communication channel between a host VZSerialPortAttachment and a virtual machine console port. One or more console ports are attached to a Virtio console device.
14    ///
15    /// An optional name may be set for a console port. A console port may also be configured for use as the system console.
16    ///
17    /// See: VZConsolePortConfiguration
18    ///
19    /// See: VZVirtualMachineConfiguration.consoleDevices
20    ///
21    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtioconsoleportconfiguration?language=objc)
22    #[unsafe(super(VZConsolePortConfiguration, NSObject))]
23    #[derive(Debug, PartialEq, Eq, Hash)]
24    #[cfg(feature = "VZConsolePortConfiguration")]
25    pub struct VZVirtioConsolePortConfiguration;
26);
27
28#[cfg(feature = "VZConsolePortConfiguration")]
29extern_conformance!(
30    unsafe impl NSCopying for VZVirtioConsolePortConfiguration {}
31);
32
33#[cfg(feature = "VZConsolePortConfiguration")]
34unsafe impl CopyingHelper for VZVirtioConsolePortConfiguration {
35    type Result = Self;
36}
37
38#[cfg(feature = "VZConsolePortConfiguration")]
39extern_conformance!(
40    unsafe impl NSObjectProtocol for VZVirtioConsolePortConfiguration {}
41);
42
43#[cfg(feature = "VZConsolePortConfiguration")]
44impl VZVirtioConsolePortConfiguration {
45    extern_methods!(
46        #[unsafe(method(init))]
47        #[unsafe(method_family = init)]
48        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
49
50        /// The console port's name. The default behavior is to not use a name unless set.
51        #[unsafe(method(name))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
54
55        /// Setter for [`name`][Self::name].
56        #[unsafe(method(setName:))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn setName(&self, name: Option<&NSString>);
59
60        /// The console port may be marked for use as the system console. The default is false.
61        #[unsafe(method(isConsole))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn isConsole(&self) -> bool;
64
65        /// Setter for [`isConsole`][Self::isConsole].
66        #[unsafe(method(setIsConsole:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn setIsConsole(&self, is_console: bool);
69    );
70}
71
72/// Methods declared on superclass `VZConsolePortConfiguration`.
73#[cfg(feature = "VZConsolePortConfiguration")]
74impl VZVirtioConsolePortConfiguration {
75    extern_methods!(
76        #[unsafe(method(new))]
77        #[unsafe(method_family = new)]
78        pub unsafe fn new() -> Retained<Self>;
79    );
80}