objc2-virtualization 0.3.2

Bindings to the Virtualization 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 crate::*;

extern_class!(
    /// Directory share for a single directory.
    ///
    /// This directory share exposes a single directory from the host file system to the guest.
    ///
    /// See: VZDirectorySharingDeviceConfiguration
    ///
    /// See: VZSharedDirectory
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzsingledirectoryshare?language=objc)
    #[unsafe(super(VZDirectoryShare, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "VZDirectoryShare")]
    pub struct VZSingleDirectoryShare;
);

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

#[cfg(feature = "VZDirectoryShare")]
impl VZSingleDirectoryShare {
    extern_methods!(
        #[cfg(feature = "VZSharedDirectory")]
        /// Initialize the directory share with a directory on the host.
        ///
        /// Parameter `directory`: Directory to share.
        #[unsafe(method(initWithDirectory:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithDirectory(
            this: Allocated<Self>,
            directory: &VZSharedDirectory,
        ) -> Retained<Self>;

        #[cfg(feature = "VZSharedDirectory")]
        /// Directory on the host to share.
        #[unsafe(method(directory))]
        #[unsafe(method_family = none)]
        pub unsafe fn directory(&self) -> Retained<VZSharedDirectory>;
    );
}

/// Methods declared on superclass `VZDirectoryShare`.
#[cfg(feature = "VZDirectoryShare")]
impl VZSingleDirectoryShare {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

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