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 objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlfunctionconstantvalues?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLFunctionConstantValues;
);

extern_conformance!(
    unsafe impl NSCopying for MTLFunctionConstantValues {}
);

unsafe impl CopyingHelper for MTLFunctionConstantValues {
    type Result = Self;
}

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

impl MTLFunctionConstantValues {
    extern_methods!(
        #[cfg(feature = "MTLDataType")]
        /// # Safety
        ///
        /// - `value` must be a valid pointer.
        /// - `index` might not be bounds-checked.
        #[unsafe(method(setConstantValue:type:atIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setConstantValue_type_atIndex(
            &self,
            value: NonNull<c_void>,
            r#type: MTLDataType,
            index: NSUInteger,
        );

        #[cfg(feature = "MTLDataType")]
        /// # Safety
        ///
        /// - `values` must be a valid pointer.
        /// - `range` might not be bounds-checked.
        #[unsafe(method(setConstantValues:type:withRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setConstantValues_type_withRange(
            &self,
            values: NonNull<c_void>,
            r#type: MTLDataType,
            range: NSRange,
        );

        #[cfg(feature = "MTLDataType")]
        /// # Safety
        ///
        /// `value` must be a valid pointer.
        #[unsafe(method(setConstantValue:type:withName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setConstantValue_type_withName(
            &self,
            value: NonNull<c_void>,
            r#type: MTLDataType,
            name: &NSString,
        );

        #[unsafe(method(reset))]
        #[unsafe(method_family = none)]
        pub fn reset(&self);
    );
}

/// Methods declared on superclass `NSObject`.
impl MTLFunctionConstantValues {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for MTLFunctionConstantValues {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}