objc2_contacts/generated/
CNFetchResult.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    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnfetchresult?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct CNFetchResult<ValueType: ?Sized = AnyObject>;
14);
15
16impl<ValueType: ?Sized + Message> CNFetchResult<ValueType> {
17    /// Unchecked conversion of the generic parameter.
18    ///
19    /// # Safety
20    ///
21    /// The generic must be valid to reinterpret as the given type.
22    #[inline]
23    pub unsafe fn cast_unchecked<NewValueType: ?Sized + Message>(
24        &self,
25    ) -> &CNFetchResult<NewValueType> {
26        unsafe { &*((self as *const Self).cast()) }
27    }
28}
29
30extern_conformance!(
31    unsafe impl<ValueType: ?Sized> NSObjectProtocol for CNFetchResult<ValueType> {}
32);
33
34impl<ValueType: Message> CNFetchResult<ValueType> {
35    extern_methods!(
36        #[unsafe(method(init))]
37        #[unsafe(method_family = init)]
38        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
39
40        #[unsafe(method(new))]
41        #[unsafe(method_family = new)]
42        pub unsafe fn new() -> Retained<Self>;
43
44        #[unsafe(method(value))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn value(&self) -> Retained<ValueType>;
47
48        #[unsafe(method(currentHistoryToken))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn currentHistoryToken(&self) -> Retained<NSData>;
51    );
52}