objc2_virtualization/generated/VZMACAddress.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 /// VZMACAddress represents a media access control address (MAC address), the 48-bit ethernet address.
11 ///
12 /// The easiest way to obtain a MAC address is with +[VZMACAddress randomLocallyAdministeredAddress]. The method
13 /// returns a valid local MAC address typically used with network interfaces.
14 ///
15 /// See: VZNetworkDeviceConfiguration
16 ///
17 /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmacaddress?language=objc)
18 #[unsafe(super(NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 pub struct VZMACAddress;
21);
22
23extern_conformance!(
24 unsafe impl NSCopying for VZMACAddress {}
25);
26
27unsafe impl CopyingHelper for VZMACAddress {
28 type Result = Self;
29}
30
31extern_conformance!(
32 unsafe impl NSObjectProtocol for VZMACAddress {}
33);
34
35impl VZMACAddress {
36 extern_methods!(
37 #[unsafe(method(new))]
38 #[unsafe(method_family = new)]
39 pub unsafe fn new() -> Retained<Self>;
40
41 #[unsafe(method(init))]
42 #[unsafe(method_family = init)]
43 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
44
45 /// Initialize the VZMACAddress from a string representation of a MAC address.
46 ///
47 /// Parameter `string`: The string should be formatted representing the 6 bytes in hexadecimal separated by a colon character.
48 /// e.g. "01:23:45:ab:cd:ef"
49 ///
50 /// The alphabetical characters can appear lowercase or uppercase.
51 ///
52 /// Returns: A VZMACAddress or nil if the string is not formatted correctly.
53 #[unsafe(method(initWithString:))]
54 #[unsafe(method_family = init)]
55 pub unsafe fn initWithString(
56 this: Allocated<Self>,
57 string: &NSString,
58 ) -> Option<Retained<Self>>;
59
60 /// Create a valid, random, unicast, locally administered address.
61 ///
62 /// The generated address is not guaranteed to be unique.
63 #[unsafe(method(randomLocallyAdministeredAddress))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn randomLocallyAdministeredAddress() -> Retained<Self>;
66
67 /// The address represented as a string.
68 ///
69 /// The 6 bytes are represented in hexadecimal form, separated by a colon character.
70 /// Alphabetical characters are lowercase.
71 ///
72 /// The address is compatible with the parameter of -[VZMACAddress initWithString:].
73 #[unsafe(method(string))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn string(&self) -> Retained<NSString>;
76
77 /// True if the address is the broadcast address, false otherwise.
78 #[unsafe(method(isBroadcastAddress))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn isBroadcastAddress(&self) -> bool;
81
82 /// True if the address is a multicast address, false otherwise.
83 #[unsafe(method(isMulticastAddress))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn isMulticastAddress(&self) -> bool;
86
87 /// True if the address is a unicast address, false otherwise.
88 #[unsafe(method(isUnicastAddress))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn isUnicastAddress(&self) -> bool;
91
92 /// True if the address is a locally administered addresses (LAA), false otherwise.
93 #[unsafe(method(isLocallyAdministeredAddress))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn isLocallyAdministeredAddress(&self) -> bool;
96
97 /// True if the address is a universally administered addresses (UAA), false otherwise.
98 #[unsafe(method(isUniversallyAdministeredAddress))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn isUniversallyAdministeredAddress(&self) -> bool;
101 );
102}