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        #[unsafe(method(addObject:))]
23        #[unsafe(method_family = none)]
24        pub unsafe fn addObject_class(an_object: &AnyObject);
25
26        #[unsafe(method(addObject:))]
27        #[unsafe(method_family = none)]
28        pub unsafe fn addObject(&self, an_object: &AnyObject);
29
30        #[unsafe(method(drain))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn drain(&self);
33    );
34}
35
36/// Methods declared on superclass `NSObject`.
37impl NSAutoreleasePool {
38    extern_methods!(
39        #[unsafe(method(init))]
40        #[unsafe(method_family = init)]
41        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
42
43        #[unsafe(method(new))]
44        #[unsafe(method_family = new)]
45        pub unsafe fn new() -> Retained<Self>;
46    );
47}