objc2_virtualization/generated/VZVirtioFileSystemDeviceConfiguration.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 /// Configuration of a Virtio file system device.
12 ///
13 /// This configuration creates a Virtio file system device which allows for exposing
14 /// directories on the host to a guest via a tag label.
15 ///
16 /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtiofilesystemdeviceconfiguration?language=objc)
17 #[unsafe(super(VZDirectorySharingDeviceConfiguration, NSObject))]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(feature = "VZDirectorySharingDeviceConfiguration")]
20 pub struct VZVirtioFileSystemDeviceConfiguration;
21);
22
23#[cfg(feature = "VZDirectorySharingDeviceConfiguration")]
24extern_conformance!(
25 unsafe impl NSCopying for VZVirtioFileSystemDeviceConfiguration {}
26);
27
28#[cfg(feature = "VZDirectorySharingDeviceConfiguration")]
29unsafe impl CopyingHelper for VZVirtioFileSystemDeviceConfiguration {
30 type Result = Self;
31}
32
33#[cfg(feature = "VZDirectorySharingDeviceConfiguration")]
34extern_conformance!(
35 unsafe impl NSObjectProtocol for VZVirtioFileSystemDeviceConfiguration {}
36);
37
38#[cfg(feature = "VZDirectorySharingDeviceConfiguration")]
39impl VZVirtioFileSystemDeviceConfiguration {
40 extern_methods!(
41 /// Configuration of the Virtio file system device.
42 ///
43 /// Parameter `tag`: The label identifying this device in the guest.
44 ///
45 /// The tag is presented as a label in the guest identifying this device for mounting. The tag must be valid, which can be checked with +[VZVirtioFileSystemDeviceConfiguration validateTag:error:].
46 ///
47 /// See: +[VZVirtioFileSystemDeviceConfiguration validateTag:error:]
48 #[unsafe(method(initWithTag:))]
49 #[unsafe(method_family = init)]
50 pub unsafe fn initWithTag(this: Allocated<Self>, tag: &NSString) -> Retained<Self>;
51
52 /// Check if tag is a valid Virtio file system tag.
53 ///
54 /// Parameter `tag`: The tag to validate.
55 ///
56 /// Parameter `error`: If not nil, assigned with an error describing why the tag is not valid.
57 ///
58 /// The tag must be non-empty and less than 36 bytes when encoded in UTF-8.
59 #[unsafe(method(validateTag:error:_))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn validateTag_error(tag: &NSString) -> Result<(), Retained<NSError>>;
62
63 /// The tag is a string identifying the device.
64 ///
65 /// The tag is presented as a label in the guest identifying this device for mounting. The tag must be valid, which can be checked with +[VZVirtioFileSystemDeviceConfiguration validateTag:error:].
66 ///
67 /// See: +[VZVirtioFileSystemDeviceConfiguration validateTag:error:]
68 #[unsafe(method(tag))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn tag(&self) -> Retained<NSString>;
71
72 /// Setter for [`tag`][Self::tag].
73 ///
74 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
75 #[unsafe(method(setTag:))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn setTag(&self, tag: &NSString);
78
79 #[cfg(feature = "VZDirectoryShare")]
80 /// Directory share. Defines how host resources are exposed to the guest virtual machine.
81 ///
82 /// See: VZSingleDirectoryShare
83 ///
84 /// See: VZMultipleDirectoryShare
85 ///
86 /// See: VZLinuxRosettaDirectoryShare
87 #[unsafe(method(share))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn share(&self) -> Option<Retained<VZDirectoryShare>>;
90
91 #[cfg(feature = "VZDirectoryShare")]
92 /// Setter for [`share`][Self::share].
93 #[unsafe(method(setShare:))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn setShare(&self, share: Option<&VZDirectoryShare>);
96
97 /// The macOS automount tag.
98 ///
99 /// A device configured with this tag will be automatically mounted in a macOS guest.
100 #[unsafe(method(macOSGuestAutomountTag))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn macOSGuestAutomountTag() -> Retained<NSString>;
103 );
104}
105
106/// Methods declared on superclass `VZDirectorySharingDeviceConfiguration`.
107#[cfg(feature = "VZDirectorySharingDeviceConfiguration")]
108impl VZVirtioFileSystemDeviceConfiguration {
109 extern_methods!(
110 #[unsafe(method(new))]
111 #[unsafe(method_family = new)]
112 pub unsafe fn new() -> Retained<Self>;
113
114 #[unsafe(method(init))]
115 #[unsafe(method_family = init)]
116 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
117 );
118}