objc2_accessory_setup_kit/generated/
ASErrors.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern "C" {
10    /// NSError domain for AccessorySetupKit errors.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/accessorysetupkit/aserrordomain?language=objc)
13    pub static ASErrorDomain: &'static NSErrorDomain;
14}
15
16/// Error codes used with ASErrorDomain.
17///
18/// See also [Apple's documentation](https://developer.apple.com/documentation/accessorysetupkit/aserrorcode?language=objc)
19// NS_ERROR_ENUM
20#[repr(transparent)]
21#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
22pub struct ASErrorCode(pub NSInteger);
23impl ASErrorCode {
24    /// A code that represents a successful action.
25    #[doc(alias = "ASErrorCodeSuccess")]
26    pub const Success: Self = Self(0);
27    /// An underlying failure with an unknown cause.
28    #[doc(alias = "ASErrorCodeUnknown")]
29    pub const Unknown: Self = Self(1);
30    /// Session activation failed.
31    #[doc(alias = "ASErrorCodeActivationFailed")]
32    pub const ActivationFailed: Self = Self(100);
33    /// The session was unable to establish a connection.
34    #[doc(alias = "ASErrorCodeConnectionFailed")]
35    pub const ConnectionFailed: Self = Self(150);
36    /// Accessory discovery timed out.
37    #[doc(alias = "ASErrorCodeDiscoveryTimeout")]
38    pub const DiscoveryTimeout: Self = Self(200);
39    /// The framework couldn't find the app extension.
40    #[doc(alias = "ASErrorCodeExtensionNotFound")]
41    pub const ExtensionNotFound: Self = Self(300);
42    /// The session invalidated prior to completing the operation.
43    #[doc(alias = "ASErrorCodeInvalidated")]
44    pub const Invalidated: Self = Self(400);
45    /// The session received an invalid request.
46    #[doc(alias = "ASErrorCodeInvalidRequest")]
47    pub const InvalidRequest: Self = Self(450);
48    /// The picker received a show request when it was already active.
49    #[doc(alias = "ASErrorCodePickerAlreadyActive")]
50    pub const PickerAlreadyActive: Self = Self(500);
51    /// The picker can't be used because the app is in the background.
52    #[doc(alias = "ASErrorCodePickerRestricted")]
53    pub const PickerRestricted: Self = Self(550);
54    /// The person using the app canceled the operation.
55    #[doc(alias = "ASErrorCodeUserCancelled")]
56    pub const UserCancelled: Self = Self(700);
57    /// The person using the app restricted access.
58    #[doc(alias = "ASErrorCodeUserRestricted")]
59    pub const UserRestricted: Self = Self(750);
60}
61
62unsafe impl Encode for ASErrorCode {
63    const ENCODING: Encoding = NSInteger::ENCODING;
64}
65
66unsafe impl RefEncode for ASErrorCode {
67    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
68}