objc2_fs_kit/generated/FSEntityIdentifier.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 /// A base type that identifies containers and volumes.
12 ///
13 /// An ``FSEntityIdentifier`` is a UUID to identify a container or volume, optionally with eight bytes of qualifying (differentiating) data.
14 /// You use the qualifiers in cases in which a file server can receive multiple connections from the same client, which differ by user credentials.
15 /// In this case, the identifier for each client is the server's base UUID, and a unique qualifier that differs by client.
16 ///
17 /// > Important: Don't subclass this class.
18 ///
19 /// See also [Apple's documentation](https://developer.apple.com/documentation/fskit/fsentityidentifier?language=objc)
20 #[unsafe(super(NSObject))]
21 #[derive(Debug, PartialEq, Eq, Hash)]
22 pub struct FSEntityIdentifier;
23);
24
25extern_conformance!(
26 unsafe impl NSCoding for FSEntityIdentifier {}
27);
28
29extern_conformance!(
30 unsafe impl NSCopying for FSEntityIdentifier {}
31);
32
33unsafe impl CopyingHelper for FSEntityIdentifier {
34 type Result = Self;
35}
36
37extern_conformance!(
38 unsafe impl NSObjectProtocol for FSEntityIdentifier {}
39);
40
41extern_conformance!(
42 unsafe impl NSSecureCoding for FSEntityIdentifier {}
43);
44
45impl FSEntityIdentifier {
46 extern_methods!(
47 /// Creates an entity identifier with a random UUID.
48 #[unsafe(method(init))]
49 #[unsafe(method_family = init)]
50 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
51
52 /// Creates an entity identifier with the given UUID.
53 ///
54 /// - Parameter uuid: The UUID to use for this identifier.
55 #[unsafe(method(initWithUUID:))]
56 #[unsafe(method_family = init)]
57 pub unsafe fn initWithUUID(this: Allocated<Self>, uuid: &NSUUID) -> Retained<Self>;
58
59 /// Creates an entity identifier with the given UUID and qualifier data as a 64-bit unsigned integer.
60 /// - Parameters:
61 /// - uuid: The UUID to use for this identifier.
62 /// - qualifier: The data to distinguish entities that otherwise share the same UUID.
63 #[unsafe(method(initWithUUID:qualifier:))]
64 #[unsafe(method_family = init)]
65 pub unsafe fn initWithUUID_qualifier(
66 this: Allocated<Self>,
67 uuid: &NSUUID,
68 qualifier: u64,
69 ) -> Retained<Self>;
70
71 /// Creates an entity identifier with the given UUID and qualifier data.
72 ///
73 /// - Parameters:
74 /// - uuid: The UUID to use for this identifier.
75 /// - qualifierData: The data to distinguish entities that otherwise share the same UUID.
76 #[unsafe(method(initWithUUID:data:))]
77 #[unsafe(method_family = init)]
78 pub unsafe fn initWithUUID_data(
79 this: Allocated<Self>,
80 uuid: &NSUUID,
81 qualifier_data: &NSData,
82 ) -> Retained<Self>;
83
84 /// A UUID to uniquely identify this entity.
85 #[unsafe(method(uuid))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn uuid(&self) -> Retained<NSUUID>;
88
89 /// Setter for [`uuid`][Self::uuid].
90 ///
91 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
92 #[unsafe(method(setUuid:))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn setUuid(&self, uuid: &NSUUID);
95
96 /// An optional piece of data to distinguish entities that otherwise share the same UUID.
97 #[unsafe(method(qualifier))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn qualifier(&self) -> Option<Retained<NSData>>;
100
101 /// Setter for [`qualifier`][Self::qualifier].
102 ///
103 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
104 #[unsafe(method(setQualifier:))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn setQualifier(&self, qualifier: Option<&NSData>);
107 );
108}
109
110/// Methods declared on superclass `NSObject`.
111impl FSEntityIdentifier {
112 extern_methods!(
113 #[unsafe(method(new))]
114 #[unsafe(method_family = new)]
115 pub unsafe fn new() -> Retained<Self>;
116 );
117}