virtualbox_rs 0.4.2

A Rust library for interacting with VirtualBox, providing a safe and idiomatic interface to the VirtualBox API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
use crate::enums::{APICMode, FirmwareBootMenuMode, FirmwareType};
use crate::{FirmwareSettings, VboxError};
use crate::utility::macros::macros::{get_function_result_bool, get_function_result_number, get_function_result_str, get_function_result_unit};
use crate::utility::string_to_c_u64_str;

impl FirmwareSettings {
    /// Type of firmware (such as legacy BIOS or EFI), used for initial bootstrap in this VM.
    ///
    /// # Returns
    ///
    /// Returns [`FirmwareType`] on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::SessionType;
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    ///
    /// let firmware_settings = machine.get_firmware_settings().unwrap();
    /// let firmware_type = firmware_settings.get_firmware_type().unwrap();
    /// ```
    pub fn get_firmware_type(&self) -> Result<FirmwareType, VboxError> {
        let firmware_type = get_function_result_number!(self.object, GetFirmwareType, u32)?;
        Ok(FirmwareType::from(firmware_type))
    }
    /// Type of firmware (such as legacy BIOS or EFI), used for initial bootstrap in this VM.
    ///
    /// # Arguments
    ///
    /// * `firmware_type` - [`FirmwareType`] - Type of firmware (such as legacy BIOS or EFI), used for initial bootstrap in this VM.
    ///
    /// # Returns
    ///
    /// Returns () on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::{FirmwareType, SessionType};
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    /// let mut session = Session::init().unwrap();
    /// machine.lock_machine(&mut session, SessionType::Shared).unwrap();
    /// let machine_mut = session.get_machine().unwrap();
    ///
    /// let firmware_settings = machine_mut.get_firmware_settings().unwrap();
    /// firmware_settings.set_firmware_type(FirmwareType::EFI).unwrap();
    /// ```
    pub fn set_firmware_type(&self, firmware_type: FirmwareType) -> Result<(), VboxError> {
        let firmware_type: u32 = firmware_type.into();
        get_function_result_unit!(self.object, SetFirmwareType, firmware_type)
    }

    /// Fade in flag for BIOS logo animation.
    ///
    /// # Returns
    ///
    /// Returns bool on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::VirtualBox;
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    ///
    /// let firmware_settings = machine.get_firmware_settings().unwrap();
    /// let logo_fade_in = firmware_settings.get_logo_fade_in().unwrap();
    /// ```
    pub fn get_logo_fade_in(&self) -> Result<bool, VboxError> {
        get_function_result_bool!(self.object, GetLogoFadeIn)
    }

    /// Fade in flag for BIOS logo animation.
    ///
    /// # Arguments
    ///
    /// * `logo_fade_in` - bool - Fade in flag for BIOS logo animation.
    ///
    /// # Returns
    ///
    /// Returns () on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::{FirmwareType, SessionType};
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    /// let mut session = Session::init().unwrap();
    /// machine.lock_machine(&mut session, SessionType::Shared).unwrap();
    /// let machine_mut = session.get_machine().unwrap();
    ///
    /// let firmware_settings = machine_mut.get_firmware_settings().unwrap();
    /// firmware_settings.set_logo_fade_in(true).unwrap();
    /// ```
    pub fn set_logo_fade_in(&self, logo_fade_in: bool) -> Result<(), VboxError> {
        let logo_fade_in = if logo_fade_in { 1 } else { 0 };
        get_function_result_unit!(self.object, SetLogoFadeIn, logo_fade_in)
    }
    /// Fade out flag for BIOS logo animation.
    ///
    /// # Returns
    ///
    /// Returns bool on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::VirtualBox;
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    ///
    /// let firmware_settings = machine.get_firmware_settings().unwrap();
    /// let logo_fade_out = firmware_settings.get_logo_fade_out().unwrap();
    /// ```
    pub fn get_logo_fade_out(&self) -> Result<bool, VboxError> {
        get_function_result_bool!(self.object, GetLogoFadeOut)
    }

    /// Fade out flag for BIOS logo animation.
    ///
    /// # Arguments
    ///
    /// * `logo_fade_out` - bool - Fade out flag for BIOS logo animation.
    ///
    /// # Returns
    ///
    /// Returns () on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::{FirmwareType, SessionType};
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    /// let mut session = Session::init().unwrap();
    /// machine.lock_machine(&mut session, SessionType::Shared).unwrap();
    /// let machine_mut = session.get_machine().unwrap();
    ///
    /// let firmware_settings = machine_mut.get_firmware_settings().unwrap();
    /// firmware_settings.set_logo_fade_out(true).unwrap();
    /// ```
    pub fn set_logo_fade_out(&self, logo_fade_out: bool) -> Result<(), VboxError> {
        let logo_fade_out = if logo_fade_out { 1 } else { 0 };
        get_function_result_unit!(self.object, SetLogoFadeIn, logo_fade_out)
    }

    /// BIOS logo display time in milliseconds (0 = default).
    ///
    /// # Returns
    ///
    /// Returns u32 on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::VirtualBox;
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    ///
    /// let firmware_settings = machine.get_firmware_settings().unwrap();
    /// let logo_display_time = firmware_settings.get_logo_display_time().unwrap();
    /// ```
    pub fn get_logo_display_time(&self) -> Result<u32, VboxError> {
        get_function_result_number!(self.object, GetLogoDisplayTime, u32)
    }

    /// BIOS logo display time in milliseconds (0 = default).
    ///
    /// # Arguments
    ///
    /// * `logo_display_time` - u32 - BIOS logo display time in milliseconds (0 = default).
    ///
    /// # Returns
    ///
    /// Returns () on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::{FirmwareType, SessionType};
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    /// let mut session = Session::init().unwrap();
    /// machine.lock_machine(&mut session, SessionType::Shared).unwrap();
    /// let machine_mut = session.get_machine().unwrap();
    ///
    /// let firmware_settings = machine_mut.get_firmware_settings().unwrap();
    /// firmware_settings.set_logo_display_time(1000).unwrap();
    /// ```
    pub fn set_logo_display_time(&self, logo_display_time: u32) -> Result<(), VboxError> {
        get_function_result_unit!(self.object, SetLogoDisplayTime, logo_display_time)
    }

    /// Local file system path for external BIOS splash image.
    ///
    /// # Returns
    ///
    /// Returns &str on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::VirtualBox;
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    ///
    /// let firmware_settings = machine.get_firmware_settings().unwrap();
    /// let logo_image_path = firmware_settings.get_logo_image_path().unwrap();
    /// ```
    pub fn get_logo_image_path(&self) -> Result<&'static str, VboxError> {
        get_function_result_str!(self.object, GetLogoImagePath)
    }

    /// Local file system path for external BIOS splash image.
    ///
    /// # Arguments
    ///
    /// * `logo_image_path` - &str - BIOS logo display time in milliseconds (0 = default).
    ///
    /// # Returns
    ///
    /// Returns () on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::{FirmwareType, SessionType};
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    /// let mut session = Session::init().unwrap();
    /// machine.lock_machine(&mut session, SessionType::Shared).unwrap();
    /// let machine_mut = session.get_machine().unwrap();
    ///
    /// let firmware_settings = machine_mut.get_firmware_settings().unwrap();
    /// firmware_settings.set_logo_image_path("/home/host_user/logo.png").unwrap();
    /// ```
    pub fn set_logo_image_path(&self, logo_image_path: &str) -> Result<(), VboxError> {
        let  logo_image_path = string_to_c_u64_str(logo_image_path)?;
        get_function_result_unit!(self.object, SetLogoImagePath, logo_image_path)
    }


    /// Mode of the firmware boot device menu.
    ///
    /// # Returns
    ///
    /// Returns [`FirmwareBootMenuMode`] on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    /// use virtualbox_rs::VirtualBox;
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    ///
    /// let firmware_settings = machine.get_firmware_settings().unwrap();
    /// let boot_menu_mode = firmware_settings.get_boot_menu_mode().unwrap();
    /// ```
    pub fn get_boot_menu_mode(&self) -> Result<FirmwareBootMenuMode, VboxError> {
        let boot_menu_mode = get_function_result_number!(self.object, GetBootMenuMode, u32)?;
        Ok(FirmwareBootMenuMode::from(boot_menu_mode))
    }

    /// Mode of the firmware boot device menu.
    ///
    /// # Arguments
    ///
    /// * `boot_menu_mode` - [`FirmwareBootMenuMode`] - Mode of the firmware boot device menu.
    ///
    /// # Returns
    ///
    /// Returns () on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::{FirmwareBootMenuMode, FirmwareType, SessionType};
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    /// let mut session = Session::init().unwrap();
    /// machine.lock_machine(&mut session, SessionType::Shared).unwrap();
    /// let machine_mut = session.get_machine().unwrap();
    ///
    /// let firmware_settings = machine_mut.get_firmware_settings().unwrap();
    /// firmware_settings.set_boot_menu_mode(FirmwareBootMenuMode::MenuOnly).unwrap();
    /// ```
    pub fn set_boot_menu_mode(&self, boot_menu_mode: FirmwareBootMenuMode) -> Result<(), VboxError> {
        let boot_menu_mode = boot_menu_mode.into();
        get_function_result_unit!(self.object, SetBootMenuMode, boot_menu_mode)
    }

    /// ACPI support flag.
    ///
    /// # Returns
    ///
    /// Returns bool on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    /// use virtualbox_rs::VirtualBox;
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    ///
    /// let firmware_settings = machine.get_firmware_settings().unwrap();
    /// let acpi_enabled = firmware_settings.get_acpi_enabled().unwrap();
    /// ```
    pub fn get_acpi_enabled(&self) -> Result<bool, VboxError> {
        get_function_result_bool!(self.object, GetACPIEnabled)
    }

    /// ACPI support flag.
    ///
    /// # Arguments
    ///
    /// * `logo_fade_out` - bool - ACPI support flag.
    ///
    /// # Returns
    ///
    /// Returns () on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::{FirmwareType, SessionType};
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    /// let mut session = Session::init().unwrap();
    /// machine.lock_machine(&mut session, SessionType::Shared).unwrap();
    /// let machine_mut = session.get_machine().unwrap();
    ///
    /// let firmware_settings = machine_mut.get_firmware_settings().unwrap();
    /// firmware_settings.set_acpi_enabled(true).unwrap();
    /// ```
    pub fn set_acpi_enabled(&self, acpi_enabled: bool) -> Result<(), VboxError> {
        let acpi_enabled = if acpi_enabled { 1 } else { 0 };
        get_function_result_unit!(self.object, SetACPIEnabled, acpi_enabled)
    }

    /// I/O-APIC support flag.
    ///
    /// If set, VirtualBox will provide an I/O-APIC and support IRQs above 15.
    ///
    /// # Returns
    ///
    /// Returns bool on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    /// use virtualbox_rs::VirtualBox;
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    ///
    /// let firmware_settings = machine.get_firmware_settings().unwrap();
    /// let io_apic_enabled = firmware_settings.get_io_apic_enabled().unwrap();
    /// ```
    pub fn get_io_apic_enabled(&self) -> Result<bool, VboxError> {
        get_function_result_bool!(self.object, GetIOAPICEnabled)
    }

    /// I/O-APIC support flag.
    ///
    /// If set, VirtualBox will provide an I/O-APIC and support IRQs above 15.
    ///
    /// # Arguments
    ///
    /// * `logo_fade_out` - bool - If set, VirtualBox will provide an I/O-APIC and support IRQs above 15.
    ///
    /// # Returns
    ///
    /// Returns () on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::{FirmwareType, SessionType};
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    /// let mut session = Session::init().unwrap();
    /// machine.lock_machine(&mut session, SessionType::Shared).unwrap();
    /// let machine_mut = session.get_machine().unwrap();
    ///
    /// let firmware_settings = machine_mut.get_firmware_settings().unwrap();
    /// firmware_settings.set_io_apic_enabled(true).unwrap();
    /// ```
    pub fn set_io_apic_enabled(&self, io_apic_enabled: bool) -> Result<(), VboxError> {
        let io_apic_enabled = if io_apic_enabled { 1 } else { 0 };
        get_function_result_unit!(self.object, SetIOAPICEnabled, io_apic_enabled)
    }

    /// Mode of the firmware boot device menu.
    ///
    /// # Returns
    ///
    /// Returns [`APICMode`] on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    /// use virtualbox_rs::VirtualBox;
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    ///
    /// let firmware_settings = machine.get_firmware_settings().unwrap();
    /// let apic_mode = firmware_settings.get_apic_mode().unwrap();
    /// ```
    pub fn get_apic_mode(&self) -> Result<APICMode, VboxError> {
        let apic_mode = get_function_result_number!(self.object, GetAPICMode, u32)?;
        Ok(APICMode::from(apic_mode))
    }

    /// Mode of the firmware boot device menu.
    ///
    /// # Arguments
    ///
    /// * `apic_mode` - [`APICMode`] - Mode of the firmware boot device menu.
    ///
    /// # Returns
    ///
    /// Returns () on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::{APICMode, FirmwareBootMenuMode, FirmwareType, SessionType};
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    /// let mut session = Session::init().unwrap();
    /// machine.lock_machine(&mut session, SessionType::Shared).unwrap();
    /// let machine_mut = session.get_machine().unwrap();
    ///
    /// let firmware_settings = machine_mut.get_firmware_settings().unwrap();
    /// firmware_settings.set_apic_mode(APICMode::APIC).unwrap();
    /// ```
    pub fn set_apic_mode(&self, apic_mode: APICMode) -> Result<(), VboxError> {
        let apic_mode = apic_mode.into();
        get_function_result_unit!(self.object, SetAPICMode, apic_mode)
    }


    /// Offset in milliseconds from the host system time.
    ///
    /// This allows for guests running with a different system date/time than the host. It is equivalent to setting the system date/time in the BIOS except it is not an absolute value but a relative one. Guest Additions time synchronization honors this offset.
    ///
    /// # Returns
    ///
    /// Returns i64 on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    /// use virtualbox_rs::VirtualBox;
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    ///
    /// let firmware_settings = machine.get_firmware_settings().unwrap();
    /// let time_offset = firmware_settings.get_time_offset().unwrap();
    /// ```
    pub fn get_time_offset(&self) -> Result<i64, VboxError> {
        get_function_result_number!(self.object, GetTimeOffset, i64)
    }

    /// Offset in milliseconds from the host system time.
    ///
    /// This allows for guests running with a different system date/time than the host. It is equivalent to setting the system date/time in the BIOS except it is not an absolute value but a relative one. Guest Additions time synchronization honors this offset.
    ///
    /// # Arguments
    ///
    /// * `time_offset` - i64 - Offset in milliseconds from the host system time.
    ///
    /// # Returns
    ///
    /// Returns () on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::{FirmwareType, SessionType};
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    /// let mut session = Session::init().unwrap();
    /// machine.lock_machine(&mut session, SessionType::Shared).unwrap();
    /// let machine_mut = session.get_machine().unwrap();
    ///
    /// let firmware_settings = machine_mut.get_firmware_settings().unwrap();
    /// firmware_settings.set_time_offset(1000).unwrap();
    /// ```
    pub fn set_time_offset(&self, time_offset: i64) -> Result<(), VboxError> {
        get_function_result_unit!(self.object, SetTimeOffset, time_offset)
    }

    /// PXE debug logging flag.
    ///
    /// If set, VirtualBox will write extensive PXE trace information to the release log.
    ///
    /// # Returns
    ///
    /// Returns bool on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    /// use virtualbox_rs::VirtualBox;
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    ///
    /// let firmware_settings = machine.get_firmware_settings().unwrap();
    /// let pxe_debug_enabled = firmware_settings.get_pxe_debug_enabled().unwrap();
    /// ```
    pub fn get_pxe_debug_enabled(&self) -> Result<bool, VboxError> {
        get_function_result_bool!(self.object, GetPXEDebugEnabled)
    }

    /// PXE debug logging flag.
    ///
    /// If set, VirtualBox will write extensive PXE trace information to the release log.
    ///
    /// # Arguments
    ///
    /// * `pxe_debug_enabled` - bool - If set, VirtualBox will provide an I/O-APIC and support IRQs above 15.
    ///
    /// # Returns
    ///
    /// Returns () on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::{FirmwareType, SessionType};
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    /// let mut session = Session::init().unwrap();
    /// machine.lock_machine(&mut session, SessionType::Shared).unwrap();
    /// let machine_mut = session.get_machine().unwrap();
    ///
    /// let firmware_settings = machine_mut.get_firmware_settings().unwrap();
    /// firmware_settings.set_pxe_debug_enabled(true).unwrap();
    /// ```
    pub fn set_pxe_debug_enabled(&self, pxe_debug_enabled: bool) -> Result<(), VboxError> {
        let pxe_debug_enabled = if pxe_debug_enabled { 1 } else { 0 };
        get_function_result_unit!(self.object, SetPXEDebugEnabled, pxe_debug_enabled)
    }

    /// Flag to control whether the SMBIOS system UUID is presented in little endian form to the guest as mandated by the SMBIOS spec chapter 7.2.1.
    ///
    /// Before VirtualBox version 6.1 it was always presented in big endian form and to retain the old behavior this flag was introduced so it can be changed. VMs created with VBox 6.1 will default to true for this flag.
    ///
    /// # Returns
    ///
    /// Returns bool on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    /// use virtualbox_rs::VirtualBox;
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    ///
    /// let firmware_settings = machine.get_firmware_settings().unwrap();
    /// let sm_bios_uuid_little_endian = firmware_settings.get_sm_bios_uuid_little_endian().unwrap();
    /// ```
    pub fn get_sm_bios_uuid_little_endian(&self) -> Result<bool, VboxError> {
        get_function_result_bool!(self.object, GetSMBIOSUuidLittleEndian)
    }

    /// Flag to control whether the SMBIOS system UUID is presented in little endian form to the guest as mandated by the SMBIOS spec chapter 7.2.1.
    ///
    /// Before VirtualBox version 6.1 it was always presented in big endian form and to retain the old behavior this flag was introduced so it can be changed. VMs created with VBox 6.1 will default to true for this flag.
    ///
    /// # Arguments
    ///
    /// * `sm_bios_uuid_little_endian` - bool - Flag to control whether the SMBIOS system UUID is presented in little endian form to the guest as mandated by the SMBIOS spec chapter 7.2.1.
    ///
    /// # Returns
    ///
    /// Returns () on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::{FirmwareType, SessionType};
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    /// let mut session = Session::init().unwrap();
    /// machine.lock_machine(&mut session, SessionType::Shared).unwrap();
    /// let machine_mut = session.get_machine().unwrap();
    ///
    /// let firmware_settings = machine_mut.get_firmware_settings().unwrap();
    /// firmware_settings.set_sm_bios_uuid_little_endian(true).unwrap();
    /// ```
    pub fn set_sm_bios_uuid_little_endian(&self, sm_bios_uuid_little_endian: bool) -> Result<(), VboxError> {
        let sm_bios_uuid_little_endian = if sm_bios_uuid_little_endian { 1 } else { 0 };
        get_function_result_unit!(self.object, SetSMBIOSUuidLittleEndian, sm_bios_uuid_little_endian)
    }

    /// Flag for enabling automatic VM serial number generation.
    ///
    /// # Returns
    ///
    /// Returns bool on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    /// use virtualbox_rs::VirtualBox;
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    ///
    /// let firmware_settings = machine.get_firmware_settings().unwrap();
    /// let auto_serial_num_gen = firmware_settings.get_auto_serial_num_gen().unwrap();
    /// ```
    pub fn get_auto_serial_num_gen(&self) -> Result<bool, VboxError> {
        get_function_result_bool!(self.object, GetAutoSerialNumGen)
    }

    /// Flag for enabling automatic VM serial number generation.
    ///
    /// # Arguments
    ///
    /// * `auto_serial_num_gen` - bool - Flag for enabling automatic VM serial number generation. endian form to the guest as mandated by the SMBIOS spec chapter 7.2.1.
    ///
    /// # Returns
    ///
    /// Returns () on success, or a [`VboxError`] on failure.
    ///
    ///  # Example
    ///
    /// ```no_run
    ///
    /// use virtualbox_rs::{Session, VirtualBox};
    /// use virtualbox_rs::enums::{FirmwareType, SessionType};
    ///
    /// let vbox = VirtualBox::init().unwrap();
    /// let machine = vbox.
    ///         find_machines("Freebsd_14").unwrap();
    /// let mut session = Session::init().unwrap();
    /// machine.lock_machine(&mut session, SessionType::Shared).unwrap();
    /// let machine_mut = session.get_machine().unwrap();
    ///
    /// let firmware_settings = machine_mut.get_firmware_settings().unwrap();
    /// firmware_settings.set_auto_serial_num_gen(true).unwrap();
    /// ```
    pub fn set_auto_serial_num_gen(&self, auto_serial_num_gen: bool) -> Result<(), VboxError> {
        let auto_serial_num_gen = if auto_serial_num_gen { 1 } else { 0 };
        get_function_result_unit!(self.object, SetAutoSerialNumGen, auto_serial_num_gen)
    }
}