objc2-metal 0.3.2

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

use crate::*;

/// Represents the status of a compiler task.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4compilertaskstatus?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTL4CompilerTaskStatus(pub NSInteger);
impl MTL4CompilerTaskStatus {
    /// No status.
    #[doc(alias = "MTL4CompilerTaskStatusNone")]
    pub const None: Self = Self(0);
    /// The compiler task is currently scheduled.
    #[doc(alias = "MTL4CompilerTaskStatusScheduled")]
    pub const Scheduled: Self = Self(1);
    /// The compiler task is currently compiling.
    #[doc(alias = "MTL4CompilerTaskStatusCompiling")]
    pub const Compiling: Self = Self(2);
    /// The compiler task is finished.
    #[doc(alias = "MTL4CompilerTaskStatusFinished")]
    pub const Finished: Self = Self(3);
}

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

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

extern_protocol!(
    /// A reference to an asynchronous compilation task that you initiate from a compiler instance.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4compilertask?language=objc)
    pub unsafe trait MTL4CompilerTask: NSObjectProtocol {
        #[cfg(feature = "MTL4Compiler")]
        /// Returns the compiler instance that this asynchronous compiler task belongs to.
        #[unsafe(method(compiler))]
        #[unsafe(method_family = none)]
        fn compiler(&self) -> Retained<ProtocolObject<dyn MTL4Compiler>>;

        /// Returns the compiler task status.
        ///
        /// The default is `MTL4CompilerStatusNone`.
        #[unsafe(method(status))]
        #[unsafe(method_family = none)]
        fn status(&self) -> MTL4CompilerTaskStatus;

        /// Waits synchronously for this compile task to complete by blocking the calling thread.
        #[unsafe(method(waitUntilCompleted))]
        #[unsafe(method_family = none)]
        fn waitUntilCompleted(&self);
    }
);