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")]
28unsafe impl NSCopying for VZLinuxBootLoader {}
29
30#[cfg(feature = "VZBootLoader")]
31unsafe impl CopyingHelper for VZLinuxBootLoader {
32    type Result = Self;
33}
34
35#[cfg(feature = "VZBootLoader")]
36unsafe impl NSObjectProtocol for VZLinuxBootLoader {}
37
38#[cfg(feature = "VZBootLoader")]
39impl VZLinuxBootLoader {
40    extern_methods!(
41        /// Create a VZLinuxBootLoader with the Linux kernel passed as URL.
42        ///
43        /// Parameter `kernelURL`: The URL of Linux kernel on the local file system.
44        #[unsafe(method(initWithKernelURL:))]
45        #[unsafe(method_family = init)]
46        pub unsafe fn initWithKernelURL(
47            this: Allocated<Self>,
48            kernel_url: &NSURL,
49        ) -> Retained<Self>;
50
51        /// URL of the Linux kernel.
52        #[unsafe(method(kernelURL))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn kernelURL(&self) -> Retained<NSURL>;
55
56        /// Setter for [`kernelURL`][Self::kernelURL].
57        #[unsafe(method(setKernelURL:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn setKernelURL(&self, kernel_url: &NSURL);
60
61        /// Define the command-line parameters passed to the kernel on boot.
62        ///
63        /// ```text
64        ///  https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html
65        ///
66        /// ```
67        #[unsafe(method(commandLine))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn commandLine(&self) -> Retained<NSString>;
70
71        /// Setter for [`commandLine`][Self::commandLine].
72        #[unsafe(method(setCommandLine:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn setCommandLine(&self, command_line: &NSString);
75
76        /// Set the optional initial RAM disk. The RAM disk is mapped into memory before booting the kernel.
77        #[unsafe(method(initialRamdiskURL))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn initialRamdiskURL(&self) -> Option<Retained<NSURL>>;
80
81        /// Setter for [`initialRamdiskURL`][Self::initialRamdiskURL].
82        #[unsafe(method(setInitialRamdiskURL:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setInitialRamdiskURL(&self, initial_ramdisk_url: Option<&NSURL>);
85    );
86}
87
88/// Methods declared on superclass `VZBootLoader`.
89#[cfg(feature = "VZBootLoader")]
90impl VZLinuxBootLoader {
91    extern_methods!(
92        #[unsafe(method(new))]
93        #[unsafe(method_family = new)]
94        pub unsafe fn new() -> Retained<Self>;
95
96        #[unsafe(method(init))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
99    );
100}