objc2_virtualization/generated/VZLinuxRosettaAbstractSocketCachingOptions.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 an Abstract Socket.
11 ///
12 /// This object configures Rosetta to communicate with the Rosetta daemon using an Abstract Socket.
13 ///
14 /// See: VZLinuxRosettaCachingOptions
15 ///
16 /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzlinuxrosettaabstractsocketcachingoptions?language=objc)
17 #[unsafe(super(VZLinuxRosettaCachingOptions, NSObject))]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(feature = "VZLinuxRosettaCachingOptions")]
20 pub struct VZLinuxRosettaAbstractSocketCachingOptions;
21);
22
23#[cfg(feature = "VZLinuxRosettaCachingOptions")]
24extern_conformance!(
25 unsafe impl NSObjectProtocol for VZLinuxRosettaAbstractSocketCachingOptions {}
26);
27
28#[cfg(feature = "VZLinuxRosettaCachingOptions")]
29impl VZLinuxRosettaAbstractSocketCachingOptions {
30 extern_methods!(
31 /// Initialize options to be set on a VZLinuxRosettaDirectoryShare.
32 ///
33 /// Parameter `name`: The name of the Abstract Socket to be used to communicate with the Rosetta translation daemon. This cannot exceed maximumNameLength 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 an Abstract Socket.
38 /// If name exceeds maximumNameLength UTF-8 bytes, nil is returned and the error is set.
39 #[unsafe(method(initWithName:error:_))]
40 #[unsafe(method_family = init)]
41 pub unsafe fn initWithName_error(
42 this: Allocated<Self>,
43 name: &NSString,
44 ) -> Result<Retained<Self>, Retained<NSError>>;
45
46 /// Name set by initWithName.
47 ///
48 /// This is the name of the Abstract Socket to be used by Rosetta.
49 #[unsafe(method(name))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn name(&self) -> Retained<NSString>;
52
53 /// The maximum allowed length of name, as defined by the sockaddr_un structure in Linux.
54 #[unsafe(method(maximumNameLength))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn maximumNameLength() -> NSUInteger;
57 );
58}
59
60/// Methods declared on superclass `VZLinuxRosettaCachingOptions`.
61#[cfg(feature = "VZLinuxRosettaCachingOptions")]
62impl VZLinuxRosettaAbstractSocketCachingOptions {
63 extern_methods!(
64 #[unsafe(method(new))]
65 #[unsafe(method_family = new)]
66 pub unsafe fn new() -> Retained<Self>;
67
68 #[unsafe(method(init))]
69 #[unsafe(method_family = init)]
70 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
71 );
72}