objc2-fs-kit 0.3.2

Bindings to the FSKit 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!(
    /// An interface for apps and daemons to interact with FSKit.
    ///
    /// FSClient is the primary management interface for FSKit.
    /// Use this class to discover FSKit extensions installed on the system, including your own.
    ///
    /// > Important: Don't subclass `FSClient`.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/fskit/fsclient?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct FSClient;
);

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

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

        /// The shared instance of the FSKit client class.
        #[unsafe(method(sharedInstance))]
        #[unsafe(method_family = none)]
        pub unsafe fn sharedInstance() -> Retained<FSClient>;

        #[cfg(all(feature = "FSModuleIdentity", feature = "block2"))]
        /// Asynchronously retrieves an list of installed file system modules.
        ///
        /// In Swift, you can either call this method and pass a completion handler closure, or get the value of the `installedExtensions` property with the `async` keyword.
        ///
        /// - Parameter completionHandler: A block or closure that executes when FSKit finishes its fetch process. If the fetch succeeds, the first parameter contains an array of ``FSModuleIdentity`` instances that identify installed modules. If the fetch fails, the second parameter contains an error detailing the failure.
        #[unsafe(method(fetchInstalledExtensionsWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn fetchInstalledExtensionsWithCompletionHandler(
            &self,
            completion_handler: &block2::DynBlock<
                dyn Fn(*mut NSArray<FSModuleIdentity>, *mut NSError),
            >,
        );
    );
}

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