objc2_device_discovery_extension/generated/
DDErrors.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11    /// NSError domain for DeviceAccess errors.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dderrordomain?language=objc)
14    pub static DDErrorDomain: &'static NSString;
15}
16
17/// Error codes used with DDErrorDomain.
18/// DeviceDiscoveryExtension error code range: 350000-350999.
19///
20/// See also [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dderrorcode?language=objc)
21// NS_ERROR_ENUM
22#[repr(transparent)]
23#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
24pub struct DDErrorCode(pub NSInteger);
25impl DDErrorCode {
26    #[doc(alias = "DDErrorCodeSuccess")]
27    pub const Success: Self = Self(0);
28    /// Success.
29    #[doc(alias = "DDErrorCodeUnknown")]
30    pub const Unknown: Self = Self(350000);
31    /// Underlying failure with an unknown cause.
32    #[doc(alias = "DDErrorCodeBadParameter")]
33    pub const BadParameter: Self = Self(350001);
34    /// Bad parameter.
35    #[doc(alias = "DDErrorCodeUnsupported")]
36    pub const Unsupported: Self = Self(350002);
37    /// Unsupported value, operation, etc.
38    #[doc(alias = "DDErrorCodeTimeout")]
39    pub const Timeout: Self = Self(350003);
40    /// Session or operation timed out.
41    #[doc(alias = "DDErrorCodeInternal")]
42    pub const Internal: Self = Self(350004);
43    /// Internal problem.
44    #[doc(alias = "DDErrorCodeMissingEntitlement")]
45    pub const MissingEntitlement: Self = Self(350005);
46    /// Missing entitlement.
47    #[doc(alias = "DDErrorCodePermission")]
48    pub const Permission: Self = Self(350006);
49    /// Lacks permission to perform the operation.
50    #[doc(alias = "DDErrorCodeNext")]
51    pub const Next: Self = Self(350007);
52}
53
54unsafe impl Encode for DDErrorCode {
55    const ENCODING: Encoding = NSInteger::ENCODING;
56}
57
58unsafe impl RefEncode for DDErrorCode {
59    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
60}
61
62/// Type for returning NSError's from functions. Avoids long and repetitious method signatures.
63///
64/// See also [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dderrorouttype?language=objc)
65pub type DDErrorOutType = *mut *mut NSError;
66
67/// Invoked when a fail-able operation completes or an error occurs.
68///
69/// Parameter `inError`: nil if successful. non-nil if an error occurred.
70///
71/// See also [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dderrorhandler?language=objc)
72#[cfg(feature = "block2")]
73pub type DDErrorHandler = *mut block2::DynBlock<dyn Fn(*mut NSError)>;