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        ///
57        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
58        #[unsafe(method(setName:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn setName(&self, name: Option<&NSString>);
61
62        /// The console port may be marked for use as the system console. The default is false.
63        #[unsafe(method(isConsole))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn isConsole(&self) -> bool;
66
67        /// Setter for [`isConsole`][Self::isConsole].
68        #[unsafe(method(setIsConsole:))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn setIsConsole(&self, is_console: bool);
71    );
72}
73
74/// Methods declared on superclass `VZConsolePortConfiguration`.
75#[cfg(feature = "VZConsolePortConfiguration")]
76impl VZVirtioConsolePortConfiguration {
77    extern_methods!(
78        #[unsafe(method(new))]
79        #[unsafe(method_family = new)]
80        pub unsafe fn new() -> Retained<Self>;
81    );
82}