objc2_virtualization/generated/
VZVirtioConsolePort.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    /// Class representing a Virtio console port in a virtual machine.
12    ///
13    /// VZVirtioConsolePort should not be instantiated directly. This object can be retrieved from the VZVirtioConsoleDevice ports property.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtioconsoleport?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct VZVirtioConsolePort;
19);
20
21extern_conformance!(
22    unsafe impl NSObjectProtocol for VZVirtioConsolePort {}
23);
24
25impl VZVirtioConsolePort {
26    extern_methods!(
27        #[unsafe(method(new))]
28        #[unsafe(method_family = new)]
29        pub unsafe fn new() -> Retained<Self>;
30
31        #[unsafe(method(init))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
34
35        /// The console port name currently being used by this port.
36        ///
37        /// This property may not change while the VM is running. A null value indicates no name has been set.
38        #[unsafe(method(name))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
41
42        #[cfg(feature = "VZSerialPortAttachment")]
43        /// The console port attachment that's currently connected to this console port.
44        ///
45        /// This property may change at any time while the VM is running.
46        #[unsafe(method(attachment))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn attachment(&self) -> Option<Retained<VZSerialPortAttachment>>;
49
50        #[cfg(feature = "VZSerialPortAttachment")]
51        /// Setter for [`attachment`][Self::attachment].
52        #[unsafe(method(setAttachment:))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn setAttachment(&self, attachment: Option<&VZSerialPortAttachment>);
55    );
56}