objc2_virtualization/generated/
VZVirtioFileSystemDevice.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    /// Virtio File System Device
12    ///
13    /// This is a device that exposes host resources to the guest as a file system mount.
14    /// The directory share defines which host resources are exposed to the guest.
15    ///
16    /// This device is created through instantiating a VZVirtioFileSystemDeviceConfiguration in a VZVirtualMachineConfiguration and is available in the
17    /// VZVirtualMachine.directorySharingDevices property.
18    ///
19    /// See: VZVirtioFileSystemDeviceConfiguration
20    ///
21    /// See: VZSingleDirectoryShare
22    ///
23    /// See: VZMultipleDirectoryShare
24    ///
25    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtiofilesystemdevice?language=objc)
26    #[unsafe(super(VZDirectorySharingDevice, NSObject))]
27    #[derive(Debug, PartialEq, Eq, Hash)]
28    #[cfg(feature = "VZDirectorySharingDevice")]
29    pub struct VZVirtioFileSystemDevice;
30);
31
32#[cfg(feature = "VZDirectorySharingDevice")]
33unsafe impl NSObjectProtocol for VZVirtioFileSystemDevice {}
34
35#[cfg(feature = "VZDirectorySharingDevice")]
36impl VZVirtioFileSystemDevice {
37    extern_methods!(
38        /// The tag is a string identifying the device.
39        ///
40        /// The tag is presented as a label in the guest identifying this device for mounting.
41        #[unsafe(method(tag))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn tag(&self) -> Retained<NSString>;
44
45        #[cfg(feature = "VZDirectoryShare")]
46        /// Directory share. Defines how host resources are exposed to the guest virtual machine.
47        ///
48        /// Setting this property to VZLinuxRosettaDirectoryShare is not supported and will cause an exception to be raised.
49        ///
50        /// See: VZSingleDirectoryShare
51        ///
52        /// See: VZMultipleDirectoryShare
53        #[unsafe(method(share))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn share(&self) -> Option<Retained<VZDirectoryShare>>;
56
57        #[cfg(feature = "VZDirectoryShare")]
58        /// Setter for [`share`][Self::share].
59        #[unsafe(method(setShare:))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn setShare(&self, share: Option<&VZDirectoryShare>);
62    );
63}
64
65/// Methods declared on superclass `VZDirectorySharingDevice`.
66#[cfg(feature = "VZDirectorySharingDevice")]
67impl VZVirtioFileSystemDevice {
68    extern_methods!(
69        #[unsafe(method(new))]
70        #[unsafe(method_family = new)]
71        pub unsafe fn new() -> Retained<Self>;
72
73        #[unsafe(method(init))]
74        #[unsafe(method_family = init)]
75        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
76    );
77}