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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// Configuration of a paravirtualized storage device of type Virtio Block Device.
///
/// This device configuration creates a storage device using paravirtualization.
/// The emulated device follows the Virtio Block Device specification.
///
/// The host implementation of the device is done through an attachment subclassing VZStorageDeviceAttachment
/// like VZDiskImageStorageDeviceAttachment.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtioblockdeviceconfiguration?language=objc)
#[unsafe(super(VZStorageDeviceConfiguration, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "VZStorageDeviceConfiguration")]
pub struct VZVirtioBlockDeviceConfiguration;
);
#[cfg(feature = "VZStorageDeviceConfiguration")]
extern_conformance!(
unsafe impl NSCopying for VZVirtioBlockDeviceConfiguration {}
);
#[cfg(feature = "VZStorageDeviceConfiguration")]
unsafe impl CopyingHelper for VZVirtioBlockDeviceConfiguration {
type Result = Self;
}
#[cfg(feature = "VZStorageDeviceConfiguration")]
extern_conformance!(
unsafe impl NSObjectProtocol for VZVirtioBlockDeviceConfiguration {}
);
#[cfg(feature = "VZStorageDeviceConfiguration")]
impl VZVirtioBlockDeviceConfiguration {
extern_methods!(
#[cfg(feature = "VZStorageDeviceAttachment")]
/// Initialize a VZVirtioBlockDeviceConfiguration with a device attachment.
///
/// Parameter `attachment`: The storage device attachment. This defines how the virtualized device operates on the host side.
///
/// See: VZDiskImageStorageDeviceAttachment
#[unsafe(method(initWithAttachment:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithAttachment(
this: Allocated<Self>,
attachment: &VZStorageDeviceAttachment,
) -> Retained<Self>;
/// Check if blockDeviceIdentifier is a valid Virtio block device identifier.
///
/// Parameter `blockDeviceIdentifier`: The device identifier to validate.
///
/// Parameter `error`: If not nil, assigned with an error describing why the device identifier is not valid.
///
/// The device identifier must be at most 20 bytes in length and ASCII-encodable.
#[unsafe(method(validateBlockDeviceIdentifier:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn validateBlockDeviceIdentifier_error(
block_device_identifier: &NSString,
) -> Result<(), Retained<NSError>>;
/// The device identifier is a string identifying the Virtio block device. Empty string by default.
///
/// The identifier can be retrieved in the guest via a VIRTIO_BLK_T_GET_ID request.
///
/// The identifier must be encodable as an ASCII string of length at most 20 bytes.
/// This property can be checked with +[VZVirtioBlockDeviceConfiguration validateBlockDeviceIdentifier:error:].
///
/// See: +[VZVirtioBlockDeviceConfiguration validateBlockDeviceIdentifier:error:]
#[unsafe(method(blockDeviceIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn blockDeviceIdentifier(&self) -> Retained<NSString>;
/// Setter for [`blockDeviceIdentifier`][Self::blockDeviceIdentifier].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setBlockDeviceIdentifier:))]
#[unsafe(method_family = none)]
pub unsafe fn setBlockDeviceIdentifier(&self, block_device_identifier: &NSString);
);
}
/// Methods declared on superclass `VZStorageDeviceConfiguration`.
#[cfg(feature = "VZStorageDeviceConfiguration")]
impl VZVirtioBlockDeviceConfiguration {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}