objc2-background-assets 0.3.2

Bindings to the BackgroundAssets framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern "C" {
    /// The error domain for managed asset packs.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/backgroundassets/bamanagederrordomain?language=objc)
    pub static BAManagedErrorDomain: &'static NSErrorDomain;
}

extern "C" {
    /// The `-[NSError userInfo]` key for an asset pack’s identifier.
    ///
    /// This key is relevant when the error code is ``BAManagedErrorCode/BAManagedErrorCodeAssetPackNotFound``.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/backgroundassets/baassetpackidentifiererrorkey?language=objc)
    pub static BAAssetPackIdentifierErrorKey: &'static NSErrorUserInfoKey;
}

/// An error code for a managed asset pack.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/backgroundassets/bamanagederrorcode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct BAManagedErrorCode(pub NSInteger);
impl BAManagedErrorCode {
    /// An error code that indicates the system can’t find an asset pack with the given identifier.
    ///
    /// Refer to the value in `-[NSError userInfo]` for the key `BAAssetPackIdentifierErrorKey` for the asset pack’s identifier.
    #[doc(alias = "BAManagedErrorCodeAssetPackNotFound")]
    pub const AssetPackNotFound: Self = Self(0);
    /// An error code that indicates the system can’t find a file at the specified path.
    ///
    /// Refer to the value in `-[NSError userInfo]` for the key `NSFilePathErrorKey` for the file path.
    #[doc(alias = "BAManagedErrorCodeFileNotFound")]
    pub const FileNotFound: Self = Self(1);
}

unsafe impl Encode for BAManagedErrorCode {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for BAManagedErrorCode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}