objc2_background_assets/generated/
BAManagedError.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    /// The error domain for managed asset packs.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/backgroundassets/bamanagederrordomain?language=objc)
13    pub static BAManagedErrorDomain: &'static NSErrorDomain;
14}
15
16extern "C" {
17    /// The `-[NSError userInfo]` key for an asset pack’s identifier.
18    ///
19    /// This key is relevant when the error code is ``BAManagedErrorCode/BAManagedErrorCodeAssetPackNotFound``.
20    ///
21    /// See also [Apple's documentation](https://developer.apple.com/documentation/backgroundassets/baassetpackidentifiererrorkey?language=objc)
22    pub static BAAssetPackIdentifierErrorKey: &'static NSErrorUserInfoKey;
23}
24
25/// An error code for a managed asset pack.
26///
27/// See also [Apple's documentation](https://developer.apple.com/documentation/backgroundassets/bamanagederrorcode?language=objc)
28// NS_ENUM
29#[repr(transparent)]
30#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
31pub struct BAManagedErrorCode(pub NSInteger);
32impl BAManagedErrorCode {
33    /// An error code that indicates the system can’t find an asset pack with the given identifier.
34    ///
35    /// Refer to the value in `-[NSError userInfo]` for the key `BAAssetPackIdentifierErrorKey` for the asset pack’s identifier.
36    #[doc(alias = "BAManagedErrorCodeAssetPackNotFound")]
37    pub const AssetPackNotFound: Self = Self(0);
38    /// An error code that indicates the system can’t find a file at the specified path.
39    ///
40    /// Refer to the value in `-[NSError userInfo]` for the key `NSFilePathErrorKey` for the file path.
41    #[doc(alias = "BAManagedErrorCodeFileNotFound")]
42    pub const FileNotFound: Self = Self(1);
43}
44
45unsafe impl Encode for BAManagedErrorCode {
46    const ENCODING: Encoding = NSInteger::ENCODING;
47}
48
49unsafe impl RefEncode for BAManagedErrorCode {
50    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
51}