objc2_virtualization/generated/VZFileSerialPortAttachment.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 serial port attachment.
11 ///
12 /// VZFileSerialPortAttachment defines a serial port attachment from a file.
13 /// Any data sent by the guest on the serial interface is written to the file.
14 /// No data is sent to the guest over serial with this attachment.
15 ///
16 /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzfileserialportattachment?language=objc)
17 #[unsafe(super(VZSerialPortAttachment, NSObject))]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(feature = "VZSerialPortAttachment")]
20 pub struct VZFileSerialPortAttachment;
21);
22
23#[cfg(feature = "VZSerialPortAttachment")]
24unsafe impl NSObjectProtocol for VZFileSerialPortAttachment {}
25
26#[cfg(feature = "VZSerialPortAttachment")]
27impl VZFileSerialPortAttachment {
28 extern_methods!(
29 #[unsafe(method(new))]
30 #[unsafe(method_family = new)]
31 pub unsafe fn new() -> Retained<Self>;
32
33 #[unsafe(method(init))]
34 #[unsafe(method_family = init)]
35 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
36
37 /// Initialize the VZFileSerialPortAttachment from a URL of a file.
38 ///
39 /// Parameter `url`: The URL of the file for the attachment on the local file system.
40 ///
41 /// Parameter `shouldAppend`: True if the file should be opened in append mode, false otherwise.
42 /// When a file is opened in append mode, writing to that file will append to the end of it.
43 ///
44 /// Parameter `error`: If not nil, used to report errors if initialization fails.
45 ///
46 /// Returns: A newly initialized VZFileSerialPortAttachment. If an error was encountered returns
47 /// `nil,`and
48 /// `error`contains the error.
49 #[unsafe(method(initWithURL:append:error:_))]
50 #[unsafe(method_family = init)]
51 pub unsafe fn initWithURL_append_error(
52 this: Allocated<Self>,
53 url: &NSURL,
54 should_append: bool,
55 ) -> Result<Retained<Self>, Retained<NSError>>;
56
57 /// The URL of the file for the attachment on the local file system.
58 #[unsafe(method(URL))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn URL(&self) -> Retained<NSURL>;
61
62 /// True if the file should be opened in append mode, false otherwise.
63 #[unsafe(method(append))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn append(&self) -> bool;
66 );
67}