objc2_foundation/generated/
NSAutoreleasePool.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::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsautoreleasepool?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct NSAutoreleasePool;
14);
15
16extern_conformance!(
17    unsafe impl NSObjectProtocol for NSAutoreleasePool {}
18);
19
20impl NSAutoreleasePool {
21    extern_methods!(
22        /// # Safety
23        ///
24        /// `an_object` should be of the correct type.
25        #[unsafe(method(addObject:))]
26        #[unsafe(method_family = none)]
27        pub unsafe fn addObject_class(an_object: &AnyObject);
28
29        /// # Safety
30        ///
31        /// `an_object` should be of the correct type.
32        #[unsafe(method(addObject:))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn addObject(&self, an_object: &AnyObject);
35
36        #[unsafe(method(drain))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn drain(&self);
39    );
40}
41
42/// Methods declared on superclass `NSObject`.
43impl NSAutoreleasePool {
44    extern_methods!(
45        #[unsafe(method(init))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
48
49        #[unsafe(method(new))]
50        #[unsafe(method_family = new)]
51        pub unsafe fn new() -> Retained<Self>;
52    );
53}