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")]
24extern_conformance!(
25 unsafe impl NSObjectProtocol for VZFileSerialPortAttachment {}
26);
27
28#[cfg(feature = "VZSerialPortAttachment")]
29impl VZFileSerialPortAttachment {
30 extern_methods!(
31 #[unsafe(method(new))]
32 #[unsafe(method_family = new)]
33 pub unsafe fn new() -> Retained<Self>;
34
35 #[unsafe(method(init))]
36 #[unsafe(method_family = init)]
37 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
38
39 /// Initialize the VZFileSerialPortAttachment from a URL of a file.
40 ///
41 /// Parameter `url`: The URL of the file for the attachment on the local file system.
42 ///
43 /// Parameter `shouldAppend`: True if the file should be opened in append mode, false otherwise.
44 /// When a file is opened in append mode, writing to that file will append to the end of it.
45 ///
46 /// Parameter `error`: If not nil, used to report errors if initialization fails.
47 ///
48 /// Returns: A newly initialized VZFileSerialPortAttachment. If an error was encountered returns
49 /// `nil,`and
50 /// `error`contains the error.
51 #[unsafe(method(initWithURL:append:error:_))]
52 #[unsafe(method_family = init)]
53 pub unsafe fn initWithURL_append_error(
54 this: Allocated<Self>,
55 url: &NSURL,
56 should_append: bool,
57 ) -> Result<Retained<Self>, Retained<NSError>>;
58
59 /// The URL of the file for the attachment on the local file system.
60 #[unsafe(method(URL))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn URL(&self) -> Retained<NSURL>;
63
64 /// True if the file should be opened in append mode, false otherwise.
65 #[unsafe(method(append))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn append(&self) -> bool;
68 );
69}