objc2-ar-kit 0.3.2

Bindings to the ARKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-foundation")]
use objc2_foundation::*;

use crate::*;

/// A value describing the priority of the collaboration data.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arcollaborationdatapriority?language=objc)
// NS_ENUM
#[cfg(feature = "objc2")]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ARCollaborationDataPriority(pub NSInteger);
#[cfg(feature = "objc2")]
impl ARCollaborationDataPriority {
    /// The data is important for establishing or continuing a collaborative session. For best results, use network transmission mechanisms that ensure delivery, such as MCSessionSendDataModeReliable.
    #[doc(alias = "ARCollaborationDataPriorityCritical")]
    pub const Critical: Self = Self(0);
    /// The data is time-sensitive but not important to collaborative session quality. Timely synchronization of this data between participants produces a smoother shared session, but the session can continue if the data is not received.
    /// For best results, use network transmission mechanisms that prioritize speed over delivery guarantees, such as MCSessionSendDataModeUnreliable.
    #[doc(alias = "ARCollaborationDataPriorityOptional")]
    pub const Optional: Self = Self(1);
}

#[cfg(feature = "objc2")]
unsafe impl Encode for ARCollaborationDataPriority {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

#[cfg(feature = "objc2")]
unsafe impl RefEncode for ARCollaborationDataPriority {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

#[cfg(feature = "objc2")]
extern_class!(
    /// Object representing data for collaborative session.
    ///
    ///
    /// This data needs to be sent to each participants in the collaborative session.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arcollaborationdata?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2")]
    pub struct ARCollaborationData;
);

#[cfg(feature = "objc2")]
unsafe impl Send for ARCollaborationData {}

#[cfg(feature = "objc2")]
unsafe impl Sync for ARCollaborationData {}

#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
extern_conformance!(
    unsafe impl NSCoding for ARCollaborationData {}
);

#[cfg(feature = "objc2")]
extern_conformance!(
    unsafe impl NSObjectProtocol for ARCollaborationData {}
);

#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
extern_conformance!(
    unsafe impl NSSecureCoding for ARCollaborationData {}
);

#[cfg(feature = "objc2")]
impl ARCollaborationData {
    extern_methods!(
        /// Network priority of the data.
        ///
        /// The network implementation should respect this flag and choose the appropriate protocol.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(priority))]
        #[unsafe(method_family = none)]
        pub unsafe fn priority(&self) -> ARCollaborationDataPriority;

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

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