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")]
24unsafe impl NSObjectProtocol for VZLinuxRosettaAbstractSocketCachingOptions {}
25
26#[cfg(feature = "VZLinuxRosettaCachingOptions")]
27impl VZLinuxRosettaAbstractSocketCachingOptions {
28    extern_methods!(
29        /// Initialize options to be set on a VZLinuxRosettaDirectoryShare.
30        ///
31        /// 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.
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 an Abstract Socket.
36        /// If name exceeds maximumNameLength UTF-8 bytes, nil is returned and the error is set.
37        #[unsafe(method(initWithName:error:_))]
38        #[unsafe(method_family = init)]
39        pub unsafe fn initWithName_error(
40            this: Allocated<Self>,
41            name: &NSString,
42        ) -> Result<Retained<Self>, Retained<NSError>>;
43
44        /// Name set by initWithName.
45        ///
46        /// This is the name of the Abstract Socket to be used by Rosetta.
47        #[unsafe(method(name))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn name(&self) -> Retained<NSString>;
50
51        /// The maximum allowed length of name, as defined by the sockaddr_un structure in Linux.
52        #[unsafe(method(maximumNameLength))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn maximumNameLength() -> NSUInteger;
55    );
56}
57
58/// Methods declared on superclass `VZLinuxRosettaCachingOptions`.
59#[cfg(feature = "VZLinuxRosettaCachingOptions")]
60impl VZLinuxRosettaAbstractSocketCachingOptions {
61    extern_methods!(
62        #[unsafe(method(new))]
63        #[unsafe(method_family = new)]
64        pub unsafe fn new() -> Retained<Self>;
65
66        #[unsafe(method(init))]
67        #[unsafe(method_family = init)]
68        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
69    );
70}