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")]
23extern_conformance!(
24    unsafe impl NSObjectProtocol for VZFileHandleSerialPortAttachment {}
25);
26
27#[cfg(feature = "VZSerialPortAttachment")]
28impl VZFileHandleSerialPortAttachment {
29    extern_methods!(
30        #[unsafe(method(new))]
31        #[unsafe(method_family = new)]
32        pub unsafe fn new() -> Retained<Self>;
33
34        #[unsafe(method(init))]
35        #[unsafe(method_family = init)]
36        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
37
38        /// Initialize the VZFileHandleSerialPortAttachment from file handles.
39        ///
40        /// Parameter `fileHandleForReading`: File handle for reading from the file.
41        ///
42        /// Parameter `fileHandleForWriting`: File handle for writing to the file.
43        ///
44        /// Each file handle must either be nil or have a valid file descriptor.
45        #[unsafe(method(initWithFileHandleForReading:fileHandleForWriting:))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn initWithFileHandleForReading_fileHandleForWriting(
48            this: Allocated<Self>,
49            file_handle_for_reading: Option<&NSFileHandle>,
50            file_handle_for_writing: Option<&NSFileHandle>,
51        ) -> Retained<Self>;
52
53        /// File handle for reading from the file.
54        ///
55        /// Data written to fileHandleForReading goes to the guest.
56        #[unsafe(method(fileHandleForReading))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn fileHandleForReading(&self) -> Option<Retained<NSFileHandle>>;
59
60        /// File handle for writing to the file.
61        ///
62        /// Data sent from the guest appears on fileHandleForWriting.
63        #[unsafe(method(fileHandleForWriting))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn fileHandleForWriting(&self) -> Option<Retained<NSFileHandle>>;
66    );
67}