use super::NSString;
use crate::core::Arc;
use crate::objc::{NSInteger, NSObject};
use std::fmt;
mod domain;
mod recovery_attempting;
mod user_info_key;
pub use domain::*;
pub use recovery_attempting::*;
pub use user_info_key::*;
objc_subclass! {
pub class NSError<'data>: NSObject<'data>;
}
impl fmt::Display for NSError<'_> {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.localized_description().fmt(f)
}
}
impl NSError<'_> {
}
impl NSError<'_> {
#[inline]
pub fn code(&self) -> NSInteger {
unsafe { _msg_send_any![self, code] }
}
#[inline]
pub fn domain(&self) -> Arc<NSErrorDomain> {
unsafe { _msg_send_any![self, domain] }
}
}
impl NSError<'_> {
#[inline]
#[doc(alias = "localizedDescription")]
pub fn localized_description(&self) -> Arc<NSString> {
unsafe { _msg_send_any![self, localizedDescription] }
}
#[inline]
#[doc(alias = "localizedFailureReason")]
pub fn localized_failure_reason(&self) -> Option<Arc<NSString>> {
unsafe { _msg_send_any![self, localizedFailureReason] }
}
#[inline]
#[doc(alias = "localizedRecoverySuggestion")]
pub fn localized_recovery_suggestion(&self) -> Option<Arc<NSString>> {
unsafe { _msg_send_any![self, localizedRecoverySuggestion] }
}
#[inline]
#[doc(alias = "recoveryAttempter")]
pub fn recovery_attempter(&self) -> Option<Arc<NSErrorRecoveryAttempting>> {
unsafe { _msg_send_any![self, recoveryAttempter] }
}
#[inline]
#[doc(alias = "helpAnchor")]
pub fn help_anchor(&self) -> Option<Arc<NSString>> {
unsafe { _msg_send_any![self, helpAnchor] }
}
}
impl NSError<'_> {
}