#[repr(C)]pub struct NSError {
pub ptr: Id<Object>,
}
Expand description
Information about an error condition including a domain, a domain-specific error code, and application-specific information.
Fields§
§ptr: Id<Object>
The raw pointer to the Objective-C object.
Implementations§
Source§impl NSError
impl NSError
Sourcepub fn error_with_domain_code_user_info(
domain: NSErrorDomain,
code: Int,
dict: NSDictionary<NSErrorUserInfoKey, id>,
) -> Self
pub fn error_with_domain_code_user_info( domain: NSErrorDomain, code: Int, dict: NSDictionary<NSErrorUserInfoKey, id>, ) -> Self
Creates and initializes an NSError object for a given domain and code with a given userInfo dictionary.
Sourcepub fn init_with_domain_code_user_info(
&mut self,
domain: NSErrorDomain,
code: Int,
dict: NSDictionary<NSErrorUserInfoKey, id>,
) -> Self
pub fn init_with_domain_code_user_info( &mut self, domain: NSErrorDomain, code: Int, dict: NSDictionary<NSErrorUserInfoKey, id>, ) -> Self
Returns an NSError object initialized for a given domain and code with a given userInfo dictionary.
Sourcepub fn domain(&self) -> NSErrorDomain
pub fn domain(&self) -> NSErrorDomain
A string containing the error domain.
Sourcepub fn user_info(&self) -> NSDictionary<NSErrorUserInfoKey, id>
pub fn user_info(&self) -> NSDictionary<NSErrorUserInfoKey, id>
The user info dictionary.
Sourcepub fn localized_description(&self) -> NSString
pub fn localized_description(&self) -> NSString
A string containing the localized description of the error.
Sourcepub fn localized_recovery_options(&self) -> NSArray<NSString>
pub fn localized_recovery_options(&self) -> NSArray<NSString>
An array containing the localized titles of buttons appropriate for displaying in an alert panel.
Sourcepub fn localized_recovery_suggestion(&self) -> NSString
pub fn localized_recovery_suggestion(&self) -> NSString
A string containing the localized recovery suggestion for the error.
Sourcepub fn localized_failure_reason(&self) -> NSString
pub fn localized_failure_reason(&self) -> NSString
A string containing the localized explanation of the reason for the error.
Sourcepub fn recovery_attempter(&self) -> id
pub fn recovery_attempter(&self) -> id
The object in the user info dictionary corresponding to the NSRecoveryAttempterErrorKey key.
Sourcepub fn attempt_recovery_from_error_option_index(
&self,
error: NSError,
recovery_index: UInt,
) -> bool
pub fn attempt_recovery_from_error_option_index( &self, error: NSError, recovery_index: UInt, ) -> bool
Implemented to attempt a recovery from an error noted in an application-modal dialog.
Sourcepub fn help_anchor(&self) -> NSString
pub fn help_anchor(&self) -> NSString
A string to display in response to an alert panel help anchor button being pressed.
Sourcepub fn underlying_errors(&self) -> NSArray<NSError>
pub fn underlying_errors(&self) -> NSArray<NSError>
Methods from Deref<Target = Object>§
Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Returns a reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
Sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Returns a mutable reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.