objc2_exception_handling/generated/
NSExceptionHandler.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11 pub static NSUncaughtSystemExceptionException: Option<&'static NSString>;
13}
14
15extern "C" {
16 pub static NSUncaughtRuntimeErrorException: Option<&'static NSString>;
18}
19
20extern "C" {
21 pub static NSStackTraceKey: Option<&'static NSString>;
23}
24
25extern "C-unwind" {
26 pub fn NSExceptionHandlerResume();
27}
28
29pub const NSLogUncaughtExceptionMask: c_uint = 1 << 0;
31pub const NSHandleUncaughtExceptionMask: c_uint = 1 << 1;
33pub const NSLogUncaughtSystemExceptionMask: c_uint = 1 << 2;
35pub const NSHandleUncaughtSystemExceptionMask: c_uint = 1 << 3;
37pub const NSLogUncaughtRuntimeErrorMask: c_uint = 1 << 4;
39pub const NSHandleUncaughtRuntimeErrorMask: c_uint = 1 << 5;
41pub const NSLogTopLevelExceptionMask: c_uint = 1 << 6;
43pub const NSHandleTopLevelExceptionMask: c_uint = 1 << 7;
45pub const NSLogOtherExceptionMask: c_uint = 1 << 8;
47pub const NSHandleOtherExceptionMask: c_uint = 1 << 9;
49
50pub const NSHangOnUncaughtExceptionMask: c_uint = 1 << 0;
52pub const NSHangOnUncaughtSystemExceptionMask: c_uint = 1 << 1;
54pub const NSHangOnUncaughtRuntimeErrorMask: c_uint = 1 << 2;
56pub const NSHangOnTopLevelExceptionMask: c_uint = 1 << 3;
58pub const NSHangOnOtherExceptionMask: c_uint = 1 << 4;
60
61extern_class!(
62 #[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
102impl 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#[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 {}