objc2_fs_kit/generated/FSClient.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 /// An interface for apps and daemons to interact with FSKit.
12 ///
13 /// FSClient is the primary management interface for FSKit.
14 /// Use this class to discover FSKit extensions installed on the system, including your own.
15 ///
16 /// > Important: Don't subclass `FSClient`.
17 ///
18 /// See also [Apple's documentation](https://developer.apple.com/documentation/fskit/fsclient?language=objc)
19 #[unsafe(super(NSObject))]
20 #[derive(Debug, PartialEq, Eq, Hash)]
21 pub struct FSClient;
22);
23
24extern_conformance!(
25 unsafe impl NSObjectProtocol for FSClient {}
26);
27
28impl FSClient {
29 extern_methods!(
30 #[unsafe(method(init))]
31 #[unsafe(method_family = init)]
32 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
33
34 /// The shared instance of the FSKit client class.
35 #[unsafe(method(sharedInstance))]
36 #[unsafe(method_family = none)]
37 pub unsafe fn sharedInstance() -> Retained<FSClient>;
38
39 #[cfg(all(feature = "FSModuleIdentity", feature = "block2"))]
40 /// Asynchronously retrieves an list of installed file system modules.
41 ///
42 /// 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.
43 ///
44 /// - 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.
45 #[unsafe(method(fetchInstalledExtensionsWithCompletionHandler:))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn fetchInstalledExtensionsWithCompletionHandler(
48 &self,
49 completion_handler: &block2::DynBlock<
50 dyn Fn(*mut NSArray<FSModuleIdentity>, *mut NSError),
51 >,
52 );
53 );
54}
55
56/// Methods declared on superclass `NSObject`.
57impl FSClient {
58 extern_methods!(
59 #[unsafe(method(new))]
60 #[unsafe(method_family = new)]
61 pub unsafe fn new() -> Retained<Self>;
62 );
63}