objc2_virtualization/generated/VZMultipleDirectoryShare.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 /// Directory share for multiple directories.
11 ///
12 /// This directory share exposes multiple directories from the host file system to the guest.
13 ///
14 /// See: VZDirectorySharingDeviceConfiguration
15 ///
16 /// See: VZSharedDirectory
17 ///
18 /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmultipledirectoryshare?language=objc)
19 #[unsafe(super(VZDirectoryShare, NSObject))]
20 #[derive(Debug, PartialEq, Eq, Hash)]
21 #[cfg(feature = "VZDirectoryShare")]
22 pub struct VZMultipleDirectoryShare;
23);
24
25#[cfg(feature = "VZDirectoryShare")]
26extern_conformance!(
27 unsafe impl NSObjectProtocol for VZMultipleDirectoryShare {}
28);
29
30#[cfg(feature = "VZDirectoryShare")]
31impl VZMultipleDirectoryShare {
32 extern_methods!(
33 /// Initialize the directory share with an empty set of directories.
34 #[unsafe(method(init))]
35 #[unsafe(method_family = init)]
36 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
37
38 #[cfg(feature = "VZSharedDirectory")]
39 /// Initialize the directory share with a set of directories on the host.
40 ///
41 /// Parameter `directories`: Directories on the host to expose to the guest by name.
42 ///
43 /// The dictionary string keys will be the name for the directory. The keys must be valid names or an exception will be raised.
44 ///
45 /// See: +[VZMultipleDirectoryShare validateName:error:]
46 #[unsafe(method(initWithDirectories:))]
47 #[unsafe(method_family = init)]
48 pub unsafe fn initWithDirectories(
49 this: Allocated<Self>,
50 directories: &NSDictionary<NSString, VZSharedDirectory>,
51 ) -> Retained<Self>;
52
53 #[cfg(feature = "VZSharedDirectory")]
54 /// The directories on the host to expose to the guest.
55 ///
56 /// The dictionary string keys will be the name for the directory. The keys must be valid names or an exception will be raised.
57 ///
58 /// See: +[VZMultipleDirectoryShare validateName:error:]
59 #[unsafe(method(directories))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn directories(&self) -> Retained<NSDictionary<NSString, VZSharedDirectory>>;
62
63 /// Check if a name is a valid directory name.
64 ///
65 /// Parameter `name`: The name to validate.
66 ///
67 /// Parameter `error`: If not nil, assigned with an error describing why the name is not valid.
68 ///
69 /// The name must not be empty, have characters unsafe for file systems, be longer than NAME_MAX, or other restrictions.
70 ///
71 /// See: +[VZMultipleDirectoryShare canonicalizedNameFromName:]
72 #[unsafe(method(validateName:error:_))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn validateName_error(name: &NSString) -> Result<(), Retained<NSError>>;
75
76 /// Canonicalize a string to be a valid directory name.
77 ///
78 /// Parameter `name`: The name to canonicalize.
79 ///
80 /// This returns nil when it cannot produce a valid name. When not nil, the result is a valid directory name.
81 ///
82 /// See: +[VZMultipleDirectoryShare validateName:error:]
83 #[unsafe(method(canonicalizedNameFromName:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn canonicalizedNameFromName(name: &NSString) -> Option<Retained<NSString>>;
86 );
87}
88
89/// Methods declared on superclass `VZDirectoryShare`.
90#[cfg(feature = "VZDirectoryShare")]
91impl VZMultipleDirectoryShare {
92 extern_methods!(
93 #[unsafe(method(new))]
94 #[unsafe(method_family = new)]
95 pub unsafe fn new() -> Retained<Self>;
96 );
97}