objc2_foundation/generated/
NSGarbageCollector.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/nsgarbagecollector?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    #[deprecated = "Building Garbage Collected apps is no longer supported."]
14    pub struct NSGarbageCollector;
15);
16
17extern_conformance!(
18    unsafe impl NSObjectProtocol for NSGarbageCollector {}
19);
20
21impl NSGarbageCollector {
22    extern_methods!(
23        #[deprecated = "Building Garbage Collected apps is no longer supported."]
24        #[unsafe(method(defaultCollector))]
25        #[unsafe(method_family = none)]
26        pub unsafe fn defaultCollector() -> Retained<AnyObject>;
27
28        #[deprecated]
29        #[unsafe(method(isCollecting))]
30        #[unsafe(method_family = none)]
31        pub unsafe fn isCollecting(&self) -> bool;
32
33        #[deprecated = "Building Garbage Collected apps is no longer supported."]
34        #[unsafe(method(disable))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn disable(&self);
37
38        #[deprecated = "Building Garbage Collected apps is no longer supported."]
39        #[unsafe(method(enable))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn enable(&self);
42
43        #[deprecated = "Building Garbage Collected apps is no longer supported."]
44        #[unsafe(method(isEnabled))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn isEnabled(&self) -> bool;
47
48        #[deprecated = "Building Garbage Collected apps is no longer supported."]
49        #[unsafe(method(collectIfNeeded))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn collectIfNeeded(&self);
52
53        #[deprecated = "Building Garbage Collected apps is no longer supported."]
54        #[unsafe(method(collectExhaustively))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn collectExhaustively(&self);
57
58        /// # Safety
59        ///
60        /// `ptr` must be a valid pointer.
61        #[deprecated = "Building Garbage Collected apps is no longer supported."]
62        #[unsafe(method(disableCollectorForPointer:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn disableCollectorForPointer(&self, ptr: NonNull<c_void>);
65
66        /// # Safety
67        ///
68        /// `ptr` must be a valid pointer.
69        #[deprecated = "Building Garbage Collected apps is no longer supported."]
70        #[unsafe(method(enableCollectorForPointer:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn enableCollectorForPointer(&self, ptr: NonNull<c_void>);
73
74        #[cfg(feature = "NSZone")]
75        #[deprecated = "Building Garbage Collected apps is no longer supported."]
76        #[unsafe(method(zone))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn zone(&self) -> NonNull<NSZone>;
79    );
80}
81
82/// Methods declared on superclass `NSObject`.
83impl NSGarbageCollector {
84    extern_methods!(
85        #[unsafe(method(init))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
88
89        #[unsafe(method(new))]
90        #[unsafe(method_family = new)]
91        pub unsafe fn new() -> Retained<Self>;
92    );
93}