objc2-metal-performance-shaders 0.3.2

Bindings to the MetalPerformanceShaders 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 objc2_metal::*;

use crate::*;

extern_class!(
    /// A NSKeyedArchiver that supports the MPSDeviceProvider protocol for MPSKernel decoding
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpskeyedunarchiver?language=objc)
    #[unsafe(super(NSKeyedUnarchiver, NSCoder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MPSKeyedUnarchiver;
);

#[cfg(feature = "MPSCoreTypes")]
extern_conformance!(
    unsafe impl MPSDeviceProvider for MPSKeyedUnarchiver {}
);

extern_conformance!(
    unsafe impl NSObjectProtocol for MPSKeyedUnarchiver {}
);

impl MPSKeyedUnarchiver {
    extern_methods!(
        /// # Safety
        ///
        /// `classes` generic probably has further requirements.
        #[unsafe(method(unarchivedObjectOfClasses:fromData:device:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn unarchivedObjectOfClasses_fromData_device_error(
            classes: &NSSet<AnyClass>,
            data: &NSData,
            device: &ProtocolObject<dyn MTLDevice>,
        ) -> Result<Retained<AnyObject>, Retained<NSError>>;

        /// # Safety
        ///
        /// `cls` probably has further requirements.
        #[unsafe(method(unarchivedObjectOfClass:fromData:device:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn unarchivedObjectOfClass_fromData_device_error(
            cls: &AnyClass,
            data: &NSData,
            device: &ProtocolObject<dyn MTLDevice>,
        ) -> Result<Retained<AnyObject>, Retained<NSError>>;

        #[unsafe(method(initForReadingFromData:device:error:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initForReadingFromData_device_error(
            this: Allocated<Self>,
            data: &NSData,
            device: &ProtocolObject<dyn MTLDevice>,
            error: Option<&mut Option<Retained<NSError>>>,
        ) -> Retained<Self>;

        /// Reports which device to use for unarchiving MPSKernels
        #[unsafe(method(mpsMTLDevice))]
        #[unsafe(method_family = none)]
        pub unsafe fn mpsMTLDevice(&self) -> Retained<ProtocolObject<dyn MTLDevice>>;

        /// # Safety
        ///
        /// `classes` generic probably has further requirements.
        #[unsafe(method(unarchivedObjectOfClasses:fromData:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn unarchivedObjectOfClasses_fromData_error(
            classes: &NSSet<AnyClass>,
            data: &NSData,
        ) -> Result<Retained<AnyObject>, Retained<NSError>>;

        /// # Safety
        ///
        /// `cls` probably has further requirements.
        #[unsafe(method(unarchivedObjectOfClass:fromData:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn unarchivedObjectOfClass_fromData_error(
            cls: &AnyClass,
            data: &NSData,
        ) -> Result<Retained<AnyObject>, Retained<NSError>>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(initForReadingFromData:error:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initForReadingFromData_error(
            this: Allocated<Self>,
            data: &NSData,
            error: Option<&mut Option<Retained<NSError>>>,
        ) -> Retained<Self>;

        #[unsafe(method(unarchiveObjectWithData:))]
        #[unsafe(method_family = none)]
        pub unsafe fn unarchiveObjectWithData(data: &NSData) -> Option<Retained<AnyObject>>;

        #[deprecated]
        #[unsafe(method(unarchiveObjectWithData:device:))]
        #[unsafe(method_family = none)]
        pub unsafe fn unarchiveObjectWithData_device(
            data: &NSData,
            device: &ProtocolObject<dyn MTLDevice>,
        ) -> Option<Retained<AnyObject>>;

        #[unsafe(method(unarchiveTopLevelObjectWithData:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn unarchiveTopLevelObjectWithData_error(
            data: &NSData,
        ) -> Result<Retained<AnyObject>, Retained<NSError>>;

        #[deprecated]
        #[unsafe(method(unarchiveTopLevelObjectWithData:device:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn unarchiveTopLevelObjectWithData_device_error(
            data: &NSData,
            device: &ProtocolObject<dyn MTLDevice>,
        ) -> Result<Retained<AnyObject>, Retained<NSError>>;

        #[unsafe(method(unarchiveObjectWithFile:))]
        #[unsafe(method_family = none)]
        pub unsafe fn unarchiveObjectWithFile(path: &NSString) -> Option<Retained<AnyObject>>;

        #[unsafe(method(initForReadingWithData:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initForReadingWithData(
            this: Allocated<Self>,
            data: &NSData,
        ) -> Retained<Self>;

        #[deprecated]
        #[unsafe(method(unarchiveObjectWithFile:device:))]
        #[unsafe(method_family = none)]
        pub unsafe fn unarchiveObjectWithFile_device(
            path: &NSString,
            device: &ProtocolObject<dyn MTLDevice>,
        ) -> Option<Retained<AnyObject>>;

        #[deprecated]
        #[unsafe(method(initWithDevice:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithDevice(
            this: Allocated<Self>,
            device: &ProtocolObject<dyn MTLDevice>,
        ) -> Option<Retained<Self>>;

        #[deprecated]
        #[unsafe(method(initForReadingWithData:device:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initForReadingWithData_device(
            this: Allocated<Self>,
            data: &NSData,
            device: &ProtocolObject<dyn MTLDevice>,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl MPSKeyedUnarchiver {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}