objc2_virtualization/generated/
VZLinuxBootLoader.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// Boot loader configuration for a Linux kernel.
12    ///
13    /// You must use a VZGenericPlatformConfiguration in conjunction with the Linux boot loader.
14    /// It is invalid to use it with any other platform configuration.
15    ///
16    /// See: VZGenericPlatformConfiguration
17    ///
18    /// See: VZVirtualMachineConfiguration.platform.
19    ///
20    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzlinuxbootloader?language=objc)
21    #[unsafe(super(VZBootLoader, NSObject))]
22    #[derive(Debug, PartialEq, Eq, Hash)]
23    #[cfg(feature = "VZBootLoader")]
24    pub struct VZLinuxBootLoader;
25);
26
27#[cfg(feature = "VZBootLoader")]
28extern_conformance!(
29    unsafe impl NSCopying for VZLinuxBootLoader {}
30);
31
32#[cfg(feature = "VZBootLoader")]
33unsafe impl CopyingHelper for VZLinuxBootLoader {
34    type Result = Self;
35}
36
37#[cfg(feature = "VZBootLoader")]
38extern_conformance!(
39    unsafe impl NSObjectProtocol for VZLinuxBootLoader {}
40);
41
42#[cfg(feature = "VZBootLoader")]
43impl VZLinuxBootLoader {
44    extern_methods!(
45        /// Create a VZLinuxBootLoader with the Linux kernel passed as URL.
46        ///
47        /// Parameter `kernelURL`: The URL of Linux kernel on the local file system.
48        #[unsafe(method(initWithKernelURL:))]
49        #[unsafe(method_family = init)]
50        pub unsafe fn initWithKernelURL(
51            this: Allocated<Self>,
52            kernel_url: &NSURL,
53        ) -> Retained<Self>;
54
55        /// URL of the Linux kernel.
56        #[unsafe(method(kernelURL))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn kernelURL(&self) -> Retained<NSURL>;
59
60        /// Setter for [`kernelURL`][Self::kernelURL].
61        #[unsafe(method(setKernelURL:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn setKernelURL(&self, kernel_url: &NSURL);
64
65        /// Define the command-line parameters passed to the kernel on boot.
66        ///
67        /// ```text
68        ///  https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html
69        ///
70        /// ```
71        #[unsafe(method(commandLine))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn commandLine(&self) -> Retained<NSString>;
74
75        /// Setter for [`commandLine`][Self::commandLine].
76        #[unsafe(method(setCommandLine:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn setCommandLine(&self, command_line: &NSString);
79
80        /// Set the optional initial RAM disk. The RAM disk is mapped into memory before booting the kernel.
81        #[unsafe(method(initialRamdiskURL))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn initialRamdiskURL(&self) -> Option<Retained<NSURL>>;
84
85        /// Setter for [`initialRamdiskURL`][Self::initialRamdiskURL].
86        #[unsafe(method(setInitialRamdiskURL:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn setInitialRamdiskURL(&self, initial_ramdisk_url: Option<&NSURL>);
89    );
90}
91
92/// Methods declared on superclass `VZBootLoader`.
93#[cfg(feature = "VZBootLoader")]
94impl VZLinuxBootLoader {
95    extern_methods!(
96        #[unsafe(method(new))]
97        #[unsafe(method_family = new)]
98        pub unsafe fn new() -> Retained<Self>;
99
100        #[unsafe(method(init))]
101        #[unsafe(method_family = init)]
102        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
103    );
104}