objc2_virtualization/generated/VZLinuxRosettaUnixSocketCachingOptions.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 /// Caching options for a Unix Domain Socket.
11 ///
12 /// This object configures Rosetta to communicate with the Rosetta daemon using a Unix Domain Socket.
13 ///
14 /// See: VZLinuxRosettaCachingOptions
15 ///
16 /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzlinuxrosettaunixsocketcachingoptions?language=objc)
17 #[unsafe(super(VZLinuxRosettaCachingOptions, NSObject))]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(feature = "VZLinuxRosettaCachingOptions")]
20 pub struct VZLinuxRosettaUnixSocketCachingOptions;
21);
22
23#[cfg(feature = "VZLinuxRosettaCachingOptions")]
24extern_conformance!(
25 unsafe impl NSObjectProtocol for VZLinuxRosettaUnixSocketCachingOptions {}
26);
27
28#[cfg(feature = "VZLinuxRosettaCachingOptions")]
29impl VZLinuxRosettaUnixSocketCachingOptions {
30 extern_methods!(
31 /// Initialize options to be set on a VZLinuxRosettaDirectoryShare.
32 ///
33 /// Parameter `path`: The path of the Unix Domain Socket to be used to communicate with the Rosetta translation daemon. This cannot exceed maximumPathLength UTF-8 bytes long.
34 ///
35 /// Parameter `error`: If not nil, assigned with the error if the initialization failed.
36 ///
37 /// Rosetta can be optionally configured to use cached translations from the Rosetta translation daemon communicating through a Unix Domain Socket.
38 /// If path exceeds maximumPathLength UTF-8 bytes, nil is returned and the error is set.
39 /// The guest operating system must have a directory at path created in order for translation caching to operate correctly.
40 #[unsafe(method(initWithPath:error:_))]
41 #[unsafe(method_family = init)]
42 pub unsafe fn initWithPath_error(
43 this: Allocated<Self>,
44 path: &NSString,
45 ) -> Result<Retained<Self>, Retained<NSError>>;
46
47 /// Initialize default options to be set on a VZLinuxRosettaDirectoryShare.
48 ///
49 /// The default translation caching configuration uses a Unix Domain Socket at /run/rosettad/rosetta.sock.
50 #[unsafe(method(init))]
51 #[unsafe(method_family = init)]
52 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
53
54 /// Path set by initWithPath.
55 ///
56 /// This is the path of the Unix Domain Socket to be used by Rosetta.
57 #[unsafe(method(path))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn path(&self) -> Retained<NSString>;
60
61 /// The maximum allowed length of path, as defined by the sockaddr_un structure in Linux.
62 #[unsafe(method(maximumPathLength))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn maximumPathLength() -> NSUInteger;
65 );
66}
67
68/// Methods declared on superclass `VZLinuxRosettaCachingOptions`.
69#[cfg(feature = "VZLinuxRosettaCachingOptions")]
70impl VZLinuxRosettaUnixSocketCachingOptions {
71 extern_methods!(
72 #[unsafe(method(new))]
73 #[unsafe(method_family = new)]
74 pub unsafe fn new() -> Retained<Self>;
75 );
76}