objc2_virtualization/generated/
VZDiskSynchronizationMode.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4
5use crate::*;
6
7/// [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzdisksynchronizationmode?language=objc)
8// NS_ENUM
9#[repr(transparent)]
10#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
11pub struct VZDiskSynchronizationMode(pub NSInteger);
12impl VZDiskSynchronizationMode {
13    /// Perform all synchronization operations as requested by the guest OS.
14    ///
15    /// With VZDiskSynchronizationModeFull, "flush" and "barrier" commands from the guest
16    /// result in their counterpart synchronization commands being sent to the disk implementation.
17    #[doc(alias = "VZDiskSynchronizationModeFull")]
18    pub const Full: Self = Self(0);
19    /// Do not synchronize the data with the permanent storage.
20    /// This option does not guarantee data integrity if any error condition occurs such as disk full on the host,
21    /// panic, power loss, etc.
22    ///
23    /// This mode is useful when a virtual machine is only run once to perform a task to completion or failure.
24    /// In case of failure, the state of blocks on disk and their order is undefined.
25    ///
26    /// Using this mode may result in improved performance since no synchronization with the underlying storage is necessary.
27    #[doc(alias = "VZDiskSynchronizationModeNone")]
28    pub const None: Self = Self(1);
29}
30
31unsafe impl Encode for VZDiskSynchronizationMode {
32    const ENCODING: Encoding = NSInteger::ENCODING;
33}
34
35unsafe impl RefEncode for VZDiskSynchronizationMode {
36    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}