#[repr(C)]pub struct NSException { /* private fields */ }icrate::Foundation has been moved to objc2-foundationFoundation and Foundation_NSException only.Implementations§
Source§impl NSException
impl NSException
Sourcepub fn new(
name: &NSExceptionName,
reason: Option<&NSString>,
user_info: Option<&NSDictionary<AnyObject, AnyObject>>,
) -> Option<Id<Self>>
👎Deprecated: icrate::Foundation has been moved to objc2-foundationAvailable on crate features Foundation_NSString and Foundation_NSDictionary only.
pub fn new( name: &NSExceptionName, reason: Option<&NSString>, user_info: Option<&NSDictionary<AnyObject, AnyObject>>, ) -> Option<Id<Self>>
icrate::Foundation has been moved to objc2-foundationFoundation_NSString and Foundation_NSDictionary only.Create a new NSException object.
Returns None if the exception couldn’t be created (example: If the
process is out of memory).
Sourcepub unsafe fn raise(&self) -> !
👎Deprecated: icrate::Foundation has been moved to objc2-foundation
pub unsafe fn raise(&self) -> !
icrate::Foundation has been moved to objc2-foundationRaises the exception, causing program flow to jump to the local exception handler.
This is equivalent to using objc2::exception::throw.
§Safety
Same as objc2::exception::throw.
Sourcepub fn into_exception(this: Id<Self>) -> Id<Exception>
👎Deprecated: icrate::Foundation has been moved to objc2-foundation
pub fn into_exception(this: Id<Self>) -> Id<Exception>
icrate::Foundation has been moved to objc2-foundationConvert this into an Exception object.
Sourcepub fn from_exception(obj: Id<Exception>) -> Result<Id<Self>, Id<Exception>>
👎Deprecated: icrate::Foundation has been moved to objc2-foundation
pub fn from_exception(obj: Id<Exception>) -> Result<Id<Self>, Id<Exception>>
icrate::Foundation has been moved to objc2-foundationCreate this from an Exception object.
This should be considered a hint; it may return Err in very, very
few cases where the object is actually an instance of NSException.
Source§impl NSException
impl NSException
pub unsafe fn exceptionWithName_reason_userInfo( name: &NSExceptionName, reason: Option<&NSString>, user_info: Option<&NSDictionary>, ) -> Id<NSException>
icrate::Foundation has been moved to objc2-foundationFoundation_NSDictionary and Foundation_NSString only.pub unsafe fn initWithName_reason_userInfo( this: Allocated<Self>, a_name: &NSExceptionName, a_reason: Option<&NSString>, a_user_info: Option<&NSDictionary>, ) -> Id<Self>
icrate::Foundation has been moved to objc2-foundationFoundation_NSDictionary and Foundation_NSString only.pub fn name(&self) -> Id<NSExceptionName>
icrate::Foundation has been moved to objc2-foundationpub fn reason(&self) -> Option<Id<NSString>>
icrate::Foundation has been moved to objc2-foundationFoundation_NSString only.pub fn userInfo(&self) -> Option<Id<NSDictionary>>
icrate::Foundation has been moved to objc2-foundationFoundation_NSDictionary only.pub unsafe fn callStackReturnAddresses(&self) -> Id<NSArray<NSNumber>>
icrate::Foundation has been moved to objc2-foundationFoundation_NSArray and Foundation_NSNumber only.pub unsafe fn callStackSymbols(&self) -> Id<NSArray<NSString>>
icrate::Foundation has been moved to objc2-foundationFoundation_NSArray and Foundation_NSString only.Source§impl NSException
Methods declared on superclass NSObject
impl NSException
Methods declared on superclass NSObject
impl NSException
NSExceptionRaisingConveniences
Methods from Deref<Target = NSObject>§
Sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Available on crate feature AuthenticationServices only.
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
AuthenticationServices only.Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
Sourcepub fn class(&self) -> &'static AnyClass
pub fn class(&self) -> &'static AnyClass
Dynamically find the class of this object.
§Example
Check that an instance of NSObject has the precise class NSObject.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load instead.Use Ivar::load instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T.
See Ivar::load_ptr for details surrounding this.
Sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load_mut instead.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Ivar::load_mut instead.Use Ivar::load_mut instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T.
See Ivar::load_ptr for details surrounding this.
Trait Implementations§
Source§impl AsMut<AnyObject> for NSException
impl AsMut<AnyObject> for NSException
Source§impl AsMut<NSException> for NSException
impl AsMut<NSException> for NSException
Source§impl AsMut<NSObject> for NSException
impl AsMut<NSObject> for NSException
Source§impl AsRef<AnyObject> for NSException
impl AsRef<AnyObject> for NSException
Source§impl AsRef<NSException> for NSException
impl AsRef<NSException> for NSException
Source§impl AsRef<NSObject> for NSException
impl AsRef<NSObject> for NSException
Source§impl Borrow<AnyObject> for NSException
impl Borrow<AnyObject> for NSException
Source§impl Borrow<NSObject> for NSException
impl Borrow<NSObject> for NSException
Source§impl BorrowMut<AnyObject> for NSException
impl BorrowMut<AnyObject> for NSException
Source§fn borrow_mut(&mut self) -> &mut AnyObject
fn borrow_mut(&mut self) -> &mut AnyObject
Source§impl BorrowMut<NSObject> for NSException
impl BorrowMut<NSObject> for NSException
Source§fn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
Source§impl ClassType for NSException
impl ClassType for NSException
Source§const NAME: &'static str = "NSException"
const NAME: &'static str = "NSException"
Source§type Mutability = InteriorMutable
type Mutability = InteriorMutable
Source§fn class() -> &'static AnyClass
fn class() -> &'static AnyClass
Source§fn as_super_mut(&mut self) -> &mut Self::Super
fn as_super_mut(&mut self) -> &mut Self::Super
Source§impl Debug for NSException
Available on crate feature Foundation_NSString only.
impl Debug for NSException
Foundation_NSString only.Source§impl Deref for NSException
impl Deref for NSException
Source§impl DerefMut for NSException
impl DerefMut for NSException
Source§impl Hash for NSException
impl Hash for NSException
Source§impl NSCoding for NSException
impl NSCoding for NSException
Source§unsafe fn encodeWithCoder(&self, coder: &NSCoder)
unsafe fn encodeWithCoder(&self, coder: &NSCoder)
icrate::Foundation has been moved to objc2-foundationFoundation_NSCoder only.