objc2_intents/generated/
INObjectSection.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/intents/inobjectsection?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct INObjectSection<ObjectType: ?Sized = AnyObject>;
14);
15
16impl<ObjectType: ?Sized + Message> INObjectSection<ObjectType> {
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<NewObjectType: ?Sized + Message>(
24        &self,
25    ) -> &INObjectSection<NewObjectType> {
26        unsafe { &*((self as *const Self).cast()) }
27    }
28}
29
30extern_conformance!(
31    unsafe impl<ObjectType: ?Sized + NSCoding> NSCoding for INObjectSection<ObjectType> {}
32);
33
34extern_conformance!(
35    unsafe impl<ObjectType: ?Sized> NSCopying for INObjectSection<ObjectType> {}
36);
37
38unsafe impl<ObjectType: ?Sized + Message> CopyingHelper for INObjectSection<ObjectType> {
39    type Result = Self;
40}
41
42extern_conformance!(
43    unsafe impl<ObjectType: ?Sized> NSObjectProtocol for INObjectSection<ObjectType> {}
44);
45
46extern_conformance!(
47    unsafe impl<ObjectType: ?Sized + NSSecureCoding> NSSecureCoding for INObjectSection<ObjectType> {}
48);
49
50impl<ObjectType: Message> INObjectSection<ObjectType> {
51    extern_methods!(
52        #[unsafe(method(title))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
55
56        #[unsafe(method(items))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn items(&self) -> Retained<NSArray<ObjectType>>;
59
60        #[unsafe(method(initWithTitle:items:))]
61        #[unsafe(method_family = init)]
62        pub unsafe fn initWithTitle_items(
63            this: Allocated<Self>,
64            title: Option<&NSString>,
65            items: &NSArray<ObjectType>,
66        ) -> Retained<Self>;
67
68        #[unsafe(method(init))]
69        #[unsafe(method_family = init)]
70        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
71    );
72}
73
74/// Methods declared on superclass `NSObject`.
75impl<ObjectType: Message> INObjectSection<ObjectType> {
76    extern_methods!(
77        #[unsafe(method(new))]
78        #[unsafe(method_family = new)]
79        pub unsafe fn new() -> Retained<Self>;
80    );
81}