objc2_exception_handling/generated/
NSExceptionHandler.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11    /// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nsuncaughtsystemexceptionexception?language=objc)
12    pub static NSUncaughtSystemExceptionException: Option<&'static NSString>;
13}
14
15extern "C" {
16    /// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nsuncaughtruntimeerrorexception?language=objc)
17    pub static NSUncaughtRuntimeErrorException: Option<&'static NSString>;
18}
19
20extern "C" {
21    /// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nsstacktracekey?language=objc)
22    pub static NSStackTraceKey: Option<&'static NSString>;
23}
24
25extern "C-unwind" {
26    pub fn NSExceptionHandlerResume();
27}
28
29/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nsloguncaughtexceptionmask?language=objc)
30pub const NSLogUncaughtExceptionMask: c_uint = 1 << 0;
31/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nshandleuncaughtexceptionmask?language=objc)
32pub const NSHandleUncaughtExceptionMask: c_uint = 1 << 1;
33/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nsloguncaughtsystemexceptionmask?language=objc)
34pub const NSLogUncaughtSystemExceptionMask: c_uint = 1 << 2;
35/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nshandleuncaughtsystemexceptionmask?language=objc)
36pub const NSHandleUncaughtSystemExceptionMask: c_uint = 1 << 3;
37/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nsloguncaughtruntimeerrormask?language=objc)
38pub const NSLogUncaughtRuntimeErrorMask: c_uint = 1 << 4;
39/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nshandleuncaughtruntimeerrormask?language=objc)
40pub const NSHandleUncaughtRuntimeErrorMask: c_uint = 1 << 5;
41/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nslogtoplevelexceptionmask?language=objc)
42pub const NSLogTopLevelExceptionMask: c_uint = 1 << 6;
43/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nshandletoplevelexceptionmask?language=objc)
44pub const NSHandleTopLevelExceptionMask: c_uint = 1 << 7;
45/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nslogotherexceptionmask?language=objc)
46pub const NSLogOtherExceptionMask: c_uint = 1 << 8;
47/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nshandleotherexceptionmask?language=objc)
48pub const NSHandleOtherExceptionMask: c_uint = 1 << 9;
49
50/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nshangonuncaughtexceptionmask?language=objc)
51pub const NSHangOnUncaughtExceptionMask: c_uint = 1 << 0;
52/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nshangonuncaughtsystemexceptionmask?language=objc)
53pub const NSHangOnUncaughtSystemExceptionMask: c_uint = 1 << 1;
54/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nshangonuncaughtruntimeerrormask?language=objc)
55pub const NSHangOnUncaughtRuntimeErrorMask: c_uint = 1 << 2;
56/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nshangontoplevelexceptionmask?language=objc)
57pub const NSHangOnTopLevelExceptionMask: c_uint = 1 << 3;
58/// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nshangonotherexceptionmask?language=objc)
59pub const NSHangOnOtherExceptionMask: c_uint = 1 << 4;
60
61extern_class!(
62    /// [Apple's documentation](https://developer.apple.com/documentation/exceptionhandling/nsexceptionhandler?language=objc)
63    #[unsafe(super(NSObject))]
64    #[derive(Debug, PartialEq, Eq, Hash)]
65    pub struct NSExceptionHandler;
66);
67
68unsafe impl NSObjectProtocol for NSExceptionHandler {}
69
70impl NSExceptionHandler {
71    extern_methods!(
72        #[unsafe(method(defaultExceptionHandler))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn defaultExceptionHandler() -> Option<Retained<NSExceptionHandler>>;
75
76        #[unsafe(method(setExceptionHandlingMask:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn setExceptionHandlingMask(&self, a_mask: NSUInteger);
79
80        #[unsafe(method(exceptionHandlingMask))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn exceptionHandlingMask(&self) -> NSUInteger;
83
84        #[unsafe(method(setExceptionHangingMask:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setExceptionHangingMask(&self, a_mask: NSUInteger);
87
88        #[unsafe(method(exceptionHangingMask))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn exceptionHangingMask(&self) -> NSUInteger;
91
92        #[unsafe(method(setDelegate:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setDelegate(&self, an_object: Option<&AnyObject>);
95
96        #[unsafe(method(delegate))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn delegate(&self) -> Option<Retained<AnyObject>>;
99    );
100}
101
102/// Methods declared on superclass `NSObject`.
103impl NSExceptionHandler {
104    extern_methods!(
105        #[unsafe(method(init))]
106        #[unsafe(method_family = init)]
107        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
108
109        #[unsafe(method(new))]
110        #[unsafe(method_family = new)]
111        pub unsafe fn new() -> Retained<Self>;
112    );
113}
114
115mod private_NSObjectNSExceptionHandlerDelegate {
116    pub trait Sealed {}
117}
118
119/// Category "NSExceptionHandlerDelegate" on [`NSObject`].
120#[doc(alias = "NSExceptionHandlerDelegate")]
121pub unsafe trait NSObjectNSExceptionHandlerDelegate:
122    ClassType + Sized + private_NSObjectNSExceptionHandlerDelegate::Sealed
123{
124    extern_methods!(
125        #[unsafe(method(exceptionHandler:shouldLogException:mask:))]
126        #[unsafe(method_family = none)]
127        unsafe fn exceptionHandler_shouldLogException_mask(
128            &self,
129            sender: Option<&NSExceptionHandler>,
130            exception: Option<&NSException>,
131            a_mask: NSUInteger,
132        ) -> bool;
133
134        #[unsafe(method(exceptionHandler:shouldHandleException:mask:))]
135        #[unsafe(method_family = none)]
136        unsafe fn exceptionHandler_shouldHandleException_mask(
137            &self,
138            sender: Option<&NSExceptionHandler>,
139            exception: Option<&NSException>,
140            a_mask: NSUInteger,
141        ) -> bool;
142    );
143}
144
145impl private_NSObjectNSExceptionHandlerDelegate::Sealed for NSObject {}
146unsafe impl NSObjectNSExceptionHandlerDelegate for NSObject {}