objc2_shared_with_you_core/generated/
SWPersonIdentity.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    /// Represents an opaque Merkle tree where the root hash of the tree can uniquely identify the individual by all of their devices. The individual's devices can prove themselves to be part of this identity, and can then be used for cryptographic signatures for that individual.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/sharedwithyoucore/swpersonidentity?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct SWPersonIdentity;
16);
17
18extern_conformance!(
19    unsafe impl NSCoding for SWPersonIdentity {}
20);
21
22extern_conformance!(
23    unsafe impl NSCopying for SWPersonIdentity {}
24);
25
26unsafe impl CopyingHelper for SWPersonIdentity {
27    type Result = Self;
28}
29
30extern_conformance!(
31    unsafe impl NSObjectProtocol for SWPersonIdentity {}
32);
33
34extern_conformance!(
35    unsafe impl NSSecureCoding for SWPersonIdentity {}
36);
37
38impl SWPersonIdentity {
39    extern_methods!(
40        /// The root hash of the tree that represents this individual's identity.
41        ///
42        /// The data contains a SHA256 hash of the user's combined public identities.
43        #[unsafe(method(rootHash))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn rootHash(&self) -> Retained<NSData>;
46
47        #[unsafe(method(init))]
48        #[unsafe(method_family = init)]
49        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
50
51        #[unsafe(method(new))]
52        #[unsafe(method_family = new)]
53        pub unsafe fn new() -> Retained<Self>;
54
55        /// An initializer
56        ///
57        /// Parameter `rootHash`: The root hash of the tree that represents this individual's identity.
58        ///
59        /// The data contains a SHA256 hash of the user's combined public identities.
60        #[unsafe(method(initWithRootHash:))]
61        #[unsafe(method_family = init)]
62        pub unsafe fn initWithRootHash(this: Allocated<Self>, root_hash: &NSData)
63            -> Retained<Self>;
64    );
65}