objc2_authentication_services/generated/
ASCredentialServiceIdentifier.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct ASCredentialServiceIdentifierType(pub NSInteger);
16impl ASCredentialServiceIdentifierType {
17 #[doc(alias = "ASCredentialServiceIdentifierTypeDomain")]
18 pub const Domain: Self = Self(0);
19 #[doc(alias = "ASCredentialServiceIdentifierTypeURL")]
20 pub const URL: Self = Self(1);
21}
22
23unsafe impl Encode for ASCredentialServiceIdentifierType {
24 const ENCODING: Encoding = NSInteger::ENCODING;
25}
26
27unsafe impl RefEncode for ASCredentialServiceIdentifierType {
28 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
29}
30
31extern_class!(
32 #[unsafe(super(NSObject))]
34 #[derive(Debug, PartialEq, Eq, Hash)]
35 pub struct ASCredentialServiceIdentifier;
36);
37
38extern_conformance!(
39 unsafe impl NSCoding for ASCredentialServiceIdentifier {}
40);
41
42extern_conformance!(
43 unsafe impl NSCopying for ASCredentialServiceIdentifier {}
44);
45
46unsafe impl CopyingHelper for ASCredentialServiceIdentifier {
47 type Result = Self;
48}
49
50extern_conformance!(
51 unsafe impl NSObjectProtocol for ASCredentialServiceIdentifier {}
52);
53
54extern_conformance!(
55 unsafe impl NSSecureCoding for ASCredentialServiceIdentifier {}
56);
57
58impl ASCredentialServiceIdentifier {
59 extern_methods!(
60 #[unsafe(method(initWithIdentifier:type:))]
66 #[unsafe(method_family = init)]
67 pub unsafe fn initWithIdentifier_type(
68 this: Allocated<Self>,
69 identifier: &NSString,
70 r#type: ASCredentialServiceIdentifierType,
71 ) -> Retained<Self>;
72
73 #[unsafe(method(identifier))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn identifier(&self) -> Retained<NSString>;
79
80 #[unsafe(method(type))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn r#type(&self) -> ASCredentialServiceIdentifierType;
86 );
87}
88
89impl ASCredentialServiceIdentifier {
91 extern_methods!(
92 #[unsafe(method(init))]
93 #[unsafe(method_family = init)]
94 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
95
96 #[unsafe(method(new))]
97 #[unsafe(method_family = new)]
98 pub unsafe fn new() -> Retained<Self>;
99 );
100}