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")]
24unsafe impl NSObjectProtocol for VZLinuxRosettaUnixSocketCachingOptions {}
25
26#[cfg(feature = "VZLinuxRosettaCachingOptions")]
27impl VZLinuxRosettaUnixSocketCachingOptions {
28 extern_methods!(
29 /// Initialize options to be set on a VZLinuxRosettaDirectoryShare.
30 ///
31 /// 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.
32 ///
33 /// Parameter `error`: If not nil, assigned with the error if the initialization failed.
34 ///
35 /// Rosetta can be optionally configured to use cached translations from the Rosetta translation daemon communicating through a Unix Domain Socket.
36 /// If path exceeds maximumPathLength UTF-8 bytes, nil is returned and the error is set.
37 /// The guest operating system must have a directory at path created in order for translation caching to operate correctly.
38 #[unsafe(method(initWithPath:error:_))]
39 #[unsafe(method_family = init)]
40 pub unsafe fn initWithPath_error(
41 this: Allocated<Self>,
42 path: &NSString,
43 ) -> Result<Retained<Self>, Retained<NSError>>;
44
45 /// Initialize default options to be set on a VZLinuxRosettaDirectoryShare.
46 ///
47 /// The default translation caching configuration uses a Unix Domain Socket at /run/rosettad/rosetta.sock.
48 #[unsafe(method(init))]
49 #[unsafe(method_family = init)]
50 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
51
52 /// Path set by initWithPath.
53 ///
54 /// This is the path of the Unix Domain Socket to be used by Rosetta.
55 #[unsafe(method(path))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn path(&self) -> Retained<NSString>;
58
59 /// The maximum allowed length of path, as defined by the sockaddr_un structure in Linux.
60 #[unsafe(method(maximumPathLength))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn maximumPathLength() -> NSUInteger;
63 );
64}
65
66/// Methods declared on superclass `VZLinuxRosettaCachingOptions`.
67#[cfg(feature = "VZLinuxRosettaCachingOptions")]
68impl VZLinuxRosettaUnixSocketCachingOptions {
69 extern_methods!(
70 #[unsafe(method(new))]
71 #[unsafe(method_family = new)]
72 pub unsafe fn new() -> Retained<Self>;
73 );
74}