objc2_virtualization/generated/
VZFileHandleSerialPortAttachment.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// File handle serial port attachment.
11    ///
12    /// VZFileHandleSerialPortAttachment defines a serial port attachment from a file handle.
13    /// Data written to fileHandleForReading goes to the guest. Data sent from the guest appears on fileHandleForWriting.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzfilehandleserialportattachment?language=objc)
16    #[unsafe(super(VZSerialPortAttachment, NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    #[cfg(feature = "VZSerialPortAttachment")]
19    pub struct VZFileHandleSerialPortAttachment;
20);
21
22#[cfg(feature = "VZSerialPortAttachment")]
23unsafe impl NSObjectProtocol for VZFileHandleSerialPortAttachment {}
24
25#[cfg(feature = "VZSerialPortAttachment")]
26impl VZFileHandleSerialPortAttachment {
27    extern_methods!(
28        #[unsafe(method(new))]
29        #[unsafe(method_family = new)]
30        pub unsafe fn new() -> Retained<Self>;
31
32        #[unsafe(method(init))]
33        #[unsafe(method_family = init)]
34        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
35
36        /// Initialize the VZFileHandleSerialPortAttachment from file handles.
37        ///
38        /// Parameter `fileHandleForReading`: File handle for reading from the file.
39        ///
40        /// Parameter `fileHandleForWriting`: File handle for writing to the file.
41        ///
42        /// Each file handle must either be nil or have a valid file descriptor.
43        #[unsafe(method(initWithFileHandleForReading:fileHandleForWriting:))]
44        #[unsafe(method_family = init)]
45        pub unsafe fn initWithFileHandleForReading_fileHandleForWriting(
46            this: Allocated<Self>,
47            file_handle_for_reading: Option<&NSFileHandle>,
48            file_handle_for_writing: Option<&NSFileHandle>,
49        ) -> Retained<Self>;
50
51        /// File handle for reading from the file.
52        ///
53        /// Data written to fileHandleForReading goes to the guest.
54        #[unsafe(method(fileHandleForReading))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn fileHandleForReading(&self) -> Option<Retained<NSFileHandle>>;
57
58        /// File handle for writing to the file.
59        ///
60        /// Data sent from the guest appears on fileHandleForWriting.
61        #[unsafe(method(fileHandleForWriting))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn fileHandleForWriting(&self) -> Option<Retained<NSFileHandle>>;
64    );
65}