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        #[unsafe(method(setTag:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn setTag(&self, tag: &NSString);
76
77        #[cfg(feature = "VZDirectoryShare")]
78        /// Directory share. Defines how host resources are exposed to the guest virtual machine.
79        ///
80        /// See: VZSingleDirectoryShare
81        ///
82        /// See: VZMultipleDirectoryShare
83        ///
84        /// See: VZLinuxRosettaDirectoryShare
85        #[unsafe(method(share))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn share(&self) -> Option<Retained<VZDirectoryShare>>;
88
89        #[cfg(feature = "VZDirectoryShare")]
90        /// Setter for [`share`][Self::share].
91        #[unsafe(method(setShare:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn setShare(&self, share: Option<&VZDirectoryShare>);
94
95        /// The macOS automount tag.
96        ///
97        /// A device configured with this tag will be automatically mounted in a macOS guest.
98        #[unsafe(method(macOSGuestAutomountTag))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn macOSGuestAutomountTag() -> Retained<NSString>;
101    );
102}
103
104/// Methods declared on superclass `VZDirectorySharingDeviceConfiguration`.
105#[cfg(feature = "VZDirectorySharingDeviceConfiguration")]
106impl VZVirtioFileSystemDeviceConfiguration {
107    extern_methods!(
108        #[unsafe(method(new))]
109        #[unsafe(method_family = new)]
110        pub unsafe fn new() -> Retained<Self>;
111
112        #[unsafe(method(init))]
113        #[unsafe(method_family = init)]
114        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
115    );
116}